Let's say you have four conditions for your sprite:
- Standing still, 4 frames
- Walking, 6 frames
- Jumping, 6 frames
- Crouching, 4 frames
Now, you load up all the frames into a sprite so as frame 1-4 is standing still, 5-10 is walking and so on.
To control it, you use the PlaySprite() command.
For instance, PlaySprite(spriteIndex, spriteFPS, loop, 1, 4) would play sprite spriteIndex at spriteFPS frames a second, if loop variable is 1, it will loop between frames 1 and 4. Which in this example would be the Standing Still animation. PlaySprite(spriteIndex, spriteFPS, loop, 5, 10) would be the walking animation. And so on. To Stop and Resume the animation, use StopSprite(spriteIndex) and resumeSprite(spriteIndex). To change direction of the sprite graphics, use setSpriteFlip(spriteIndex, horizontal, vertical) where a value of 1 for horizontal or vertical will flip on that axis, and 0 sets it to default direction.