7The Cannon Game

The Cannon Game gives the player control of a cannon in a world with a tempting tower of books. The player’s job is to knock down the tower in 60 seconds or less by firing cannonballs at it. The temperature of the cannon goes up every time it is fired, and it cools down slowly afterwards. The current temperature of the cannon barrel and the maximum temperature reached so far are indicated on a temperature gauge (as shown in Figure 7.1). If the cannon barrel is overstressed by heating it above the maximum allowable temperature, then it will explode the next time it is fired. (See Figures 7.27.6.) The player controls the cannon using the keyboard. Table 7.1 shows the keyboard bindings.

Although this 60-second minigame is very ...

Get Introduction to Game Physics with Box2D now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.