HTML and CSS Reference
The player then has the advantage of intelligence to compensate for the large number
of tanks the enemy employs. The other 25% of the time, an enemy tank will randomly
choose a direction to move in.
Now, let's get into the game by looking at the tile sheet we will be using.
The Tile Sheet for Our Game
Make sure you've read Chapter 4 and the Chapter 8 section “A Basic Game Frame-
work” on page 400 before moving on. Even though Micro Tank Maze is a relatively
simple game, it is still quite a few lines of code. We'll hit the major points, but we don't
have space to discuss every detail.
The tile sheet ( tanks_sheet.png ) we are going to use will look very familiar if you've read
Chapter 4 . Figure 9-11 shows tanks_sheet.png .
Figure 9-11. The Micro Tank Maze tile sheet
We will be using only a very small portion of these tiles for Micro Tank Maze .
This is the tile on which the player and the enemy tanks can move. Tile 0, the road
tile, is in the top-left corner.
The wall tile will cause any tank moving on it to be destroyed. Tile 30, the second
to last tile on the sheet, will be the wall tile.
This is the tile the player must reach to win the game. It is the last tile in the second
to last row (the phoenix).
The player will be made up of the first eight green tank tiles. Each tile will be used
to simulate the tank treads moving from tile to tile.
The enemy will be made up of the second eight blue tank tiles. These tiles will be
used to animate the tank treads as it moves from tile to tile.