This is another example of set costumes. For a tutorial on walk cycles go here: https://scratch.mit.edu/projects/413956522/ This example uses more cycles to animate. Use the arrow keys to move, up to jump(hold to jump higher) and bounce off the side to rebound(walljump). Down arrow to duck and space to attack while on the ground.
I was practically inspired by @griffpatches cat animation, so I had to make my own. I also included some other things. The simple algorithm for a cycle with as little variables as possible is: switch costume to floor(X + (Timer*10) mod Y). X = Costume number of first frame in cycle Y = Length of cycle Few problems with hitboxes I'm working on. Now with X Acceleration!