Snakes And Ladders Talk Through - Side Effects
This article runs through how the side effects (enemies) of Snakes And Ladders are animated and rendered. Each simplified demo has its source code underneath, so feel free to have a look. Pay particular attention to the code inside the enemy() function, which handles the drawing and animation. Almost every enemy uses a very similar walking pattern that you may recognise from Anthrophobia. In case you haven't already seen it, this "walking pattern" is based on a circle with a limit at its base:The Worm-like Stick Thingy
Even the first side effect uses this circular walking pattern. Notice how each of its bones move:The Centipede
This side effect is very similar to the former one, only its body is extended upwards so that its legs move instead.The Creeper
I'm sure you can figure out what's going on here.The Wolfish Side Effect
As you may have already noticed, this enemy also uses the walking motion mentioned earlier. Its four feet are divided into two pairs at the moment, but here's a challenge: If you paste the code below into a new .html file, can you give the enemy four pairs of legs? (Tip: have a look in the enemy() function)The Monster
In this simplified example, the enemy is very similar to the last. In the real game, however, it occasionally spits out cubes - shown in the next example - and jumps whenever Drillo runs underneath it.The Cubic Side Effect
This side effect might look a bit basic, but surprisingly it turned out to be the hardest one to get going. This is what it has to do: 1. Rotate in the direction it's moving.2. Bump up and down so that it looks like its rolling along the ground.
3. Close and open its eyes before and after rolling. Take a look at the source code if you need to understand it better.