HI guys!
I was looking for a way to make animation of my game, where I have player image, i googled for hours to find an understandable way of making animation, I have tried Thor, but I dont understand a thing on how to use it, and documentation didnt helped me,
ANYWAYS,I came up with this:
3 images, each one is changing if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
BUT to make them change NOT every frame i did this :
if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
{
bb++;
CC= bb % 10;
if (!CC)
// IMAGE CHANGES TO NEXT
}
What it does, is adds +1 to int bb
CC is equal to MODULUS of bb
SO, every 10 loops CC != 0
when that happens image changes
so images are changing every 10 frames
what do you think of this method? Is it okay to use? If its not can you advice something ? I did this coz im kinda desperate