Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Next, let’s build a game from scratch (well, not completely from scratch). We’ll use the same collision detection concept from the top-down driving game in Chapter 12, “Game Worlds: Driving and Racing Games.” But, instead of a car on streets, we have a marble that rolls around on the screen. And instead of using the arrow keys to control the marble, we use the iPhone’s accelerometers!
Figure 15.8 shows the game. There is a single marble that starts at the upper right. The screen is filled with walls that get in the way. At the center is a hole for the marble to fit into.