I am new to game development and currently working on a sprite based 2d side view game. I am writing in c++ using sdl2.
Currently i am taking a clip and rendering it for multiple frames and then i change the clip. For example if ihave 4 clips for run animation so i am running each clip for 5 frames (@60 fps) so basically it takes 20 frames to complete a run animation.
Similarly i have jump and shoot animations with 3 clips each. But the problem is once an animation is running i am disabling all the keys. So basically when i shoot while running the player will stop and then shoot. Once the animation is completed then i have to click the button again to start running, but what i want my player to start running automatically once the animation is over and i my forward button is not keyed up.