>>22962
Yep modulo is a good choice, but I'm unsure that the sleep will help much. Thanks Anon!
>>22964
Great! Full marks Anon.
Now, I'd suggest you enhance your system in two ways:
1. Replace this if/else pair with tests for '+' key (plus), and '-' key (minus), instead to control the rate of animation.
// Control frames speed
if (IsKeyPressed(KEY_RIGHT))
framesSpeed++;
else if (IsKeyPressed(KEY_LEFT))
framesSpeed--;
2. Now test
all four direction keys, and this time use them to choose
which row of your sprite sheet to animate (left, right, up, down) instead.
Do these two steps and you'll be very close to an animated Yotsuba geimu character. Cheers. :^)
>===
-
prose edit
Edited last time by Chobitsu on 06/05/2023 (Mon) 16:20:36.