The Cannon Game app challenges you to destroy a seven-piece target before a ten-second time limit expires (Fig. 6.1). The game consists of four visual components—a cannon that you control, a cannonball, the target and a blocker that defends the target. You aim and fire the cannon by touching the screen—the cannon then aims at the touched point and fires the cannonball in a straight line in that direction. At the end of the game, the app displays an
AlertDialog indicating whether you won or lost, and showing the number of shots fired and the elapsed time (Fig. 6.2).