The Game Engine
Mario can jump up to 4 blocks which gives you the freedom of passing all those nasty Goombas. The code for jumping is pretty neat, every block update the game engine has to check if you collide with a block. For example: Jumping to hit a question mark is triggering several events and returns Mario back down to the ground. The engine will also update the question mark to show a different shape and display the coin or mushroom.
We built in a delay of 100ms because updating the Tableau parameters too fast is resulting in an endless loop of Mario jumping around.
Besides listening to arrow keys is the game engine also updating a step parameter. This step parameter is used to animate. By using a step from 1-12 we update the x position of every goomba using a sinus calculation.