Let's start drawing all the graphics. A snake prototype requires:
A background, such as a grass field
A "game over" overlay, used to add a dramatic effect when the game is over
The fruit (collectible)
The wall
The snake
They are all very easy to draw, except for the snake. In snake.fla
, create four new Movie Clip symbols and call them bg_mc
for the background, game_over_mc
for the game over overlay, fruit_mc
for the fruit, and obstacle_mc
for the wall. Set them all as exportable for ActionScript. Leave all other settings at their default values, just like you did in previous chapters.
These are the objects I drew:
From left to right, the background and the game over overlay (which is a bit transparent), both 640x480 pixels with registration point at 0,0. Then, the collectible fruit and the deadly wall, with registration point at 0,0 and inside an imaginary 40x40 pixels square. This is also the size of the tile the game is based on.
Drawing the snake is a bit harder because you...