Closer to what I want for sprite loading but still needs more work.
This commit is contained in:
parent
51858ea399
commit
6ed57cd4a8
4 changed files with 23 additions and 17 deletions
|
@ -148,9 +148,7 @@ void Raycaster::sprite_casting() {
|
|||
int texY = ((d * textureHeight) / spriteHeight) / textureHeight;
|
||||
|
||||
sf_sprite->setScale({sprite_w, sprite_h});
|
||||
auto time = $clock.getElapsedTime();
|
||||
int frame = int(time.asMicroseconds() / 200.0) % 4;
|
||||
sf_sprite->setTextureRect(sf::IntRect({texX + (textureWidth * frame), texY}, {texX_end - texX, textureHeight}));
|
||||
sf_sprite->setTextureRect(sf::IntRect({texX, texY}, {texX_end - texX, textureHeight}));
|
||||
sf_sprite->setPosition({x, y});
|
||||
$window.draw(*sf_sprite);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue