ABSTRACT

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 cannon has a heads-up display that registers the barrel’s current and highest temperature at left and a stop watch. The first set of private member variables are pointers to the b2Bodys for the parts of the cannon in Physics World. The initial placement of the cannonball needs some linear algebra. Clearly, it depends on both the position and the orientation of the cannon barrel. Object World is asked to move the game objects, to make the appropriate sounds, and to cool the cannon down a little. The player has lost if either the cannon has exploded or time has run out.