One of the school days used Scratch.
The day used a simple Scratch game.
It tried to get the school pupils to code a simple game where an orchard of Apple trees had fallen apples and worms.
The game has a list of apples, which waitied to be touched by a worm.
The Apples waited to be touched by a worm. If touched, the apple had a simple animation of it being eaten. It used a Countdown state machine, which stopped when it got to no apple.
I remember the worm was guided by buttons. It had a count of apples it touched, but the apple did the animation.
There was a loop that looked for buttons and changed the worms direction. Each tick the worm was moved one step in along a path.
There was a function that scanned the list of apples and compared it to the Worm's position. If the Apple was touched it got eaten.
Snake Game is a very simple game where an apple is eaten by the snake and it is added to the tail of the snake.
As the snake gets longer it gets harder.
Signalling has a web page where each signal box is modelled as an object and they listen to the down line and upline signal box for bell codes and block instruments.
http://www.dougrice.plus.com/wetString/blockSignalling/signalling.htm - simulations. Do view source.
http://www.dougrice.plus.com/dev/trySVG/pong.svg a puck moves and bumps onto a block.
http://www.dougrice.plus.com/dev/trySVG/signalHome.svg - home signal with bounce simulation.