A simple example for some code that manages animation loops and transition animations. Hold the right arrow to increase the speed variable.You should see mario start to walk, then speed up to a run. If you leave him alone, he'll stare into the sky some.
Click see inside and read the comments to learn how this works. If you want to use this in your own project, I'd appreciate it if you put a link to this project in your Notes and Credits. Example Mario Sprites from: https://www.deviantart.com/majorgenieponygirl75/art/New-Super-Mario-World-Super-Mario-Sprite-Sheet-871161324