I'm new to PICO-8 so please forgive me if something simlar has already been posted (I searched and couldn't find what I wanted)
I wanted to be able to draw on the map and then have some of those map tiles animated.
The following code will animate a map tile by copying memory from a number of sprites to a main sprite which you draw on the map.
The main sprite must be immediatly followed by the animation frames, and (for simplicity of code) all frames must be on the same row of the sprite sheet. This gives a max of 15 frames of animation in a row, with 1 main sprite.
Animation is by rotation (frame 1,2,3,4,1,2,3,4 etc) if you want ping-pong (1,2,3,4,3,2,1,2,3,4 etc) you'll need to tweak the code.
Please forgive my code, I've never used LUA before - I'm used to Atari BASIC and 6502 Assembler. I'm sure this can be done better, so if someone more experianced with LUA would like to re-write it then that would be great.

