Box2D Cannon Game
Ian Parberry's "Introduction to Game Physics with Box2D"
Box2D Cannon Game

The aim of the Cannon Game is to use a cannon to knock down a tower of crates. You must get all of the crates below a line approximately at the horizon to win. If you win, you'll see a text message telling you how many shots you used and how much time you took. There's a HUD at top left of the window with a guage that tells you the cannon's current temperature and the maximum temperature experienced so far. Firing the cannon increases the temperature and it cools over the next few seconds. If the cannon overheats, then it explodes and you lose. You have 60 seconds to knock down the tower. There's a stopwatch to the right of the temperature guage so you can see how much time is left.

Keyboard Controls

Key
Action
F1 Help (this document)
Enter Restart when over
Space Fire cannon
Up arrow Rotate cannon barrel up while key is depressed
Down arrow Rotate cannon barrel down while key is depressed
Left arrow Start cannon moving left
Right arrow Start cannon moving right
S Stop cannon
PrtScr (hold down) Save screenshot to a PNG file

The LARC Engine

This code uses the LARC Engine and is part of the LARC Code Base.