⚠️This site is a mirror of Guy Walker's Stagecast⚠️

OliverAnimation - sprite rotation

Click the sim once to enable it to respond to keyboard keys.
Click tag for playback controls and red tag for sim info and reset.

This sim shows how to control sprite animation. The spaceship character has 16 pictures. These are labelled 0 ... 15 in the Paint window.

We can calculate the next picture and put the number directly into the appearance box to switch the characters picture. So calculating:

1 ... 2 ... 3 ... etc. rotates slowly clockwise
3 ... 2 ... 1 ... etc. rotates slowly anti-clockwise
1 ... 3 ... 5 ... etc. rotates fast clockwise
1 ... 4 ... 7 ... etc. rotates very fast clockwise

To make it work, we have to use Modulo 16 arithmetic to keep the answers within range of 0 .. 15. Any answers which do not match an appearance name are ignored.
By adding 8 to the current picture number, we can 'flip', rotate the sprite 180°.

Controls:

No keyboard, only mouse

Click Play/Pause icon to toggle between play and paused.

Click the left red arrow to increase anti-clockwise rotation.
Click the right red arrow to increase clockwise rotation.
The LED bar graph indicates the speed.

While PAUSED:

Click the left red arrow to advance one picture anti-clockwise.
Click the right red arrow to advance one picture clockwise.

Click the bar graph icon to 'flip' the sprite 180°.