Game Development Reference
Figure 15.4 The accelerometer
values for the iPhone when it
is fully upright and facing you.
to 1. This shows that the force of gravity is traveling straight down
through the face of the device, as shown in Fig. 15.2 . It is important
to understand these orientation relationships, particularly x and y ,
as they will make up the core input mechanism in the game we
are about to create.
The Game: Marble Runner
In the following game example, we will create an experience similar
to the wooden marble labyrinths that have existed for many years.
Such a game is shown in Fig. 15.5 , where the player would turn
the two knobs to navigate the marble safely through the maze with-
out falling down a hole.
In our version, rather than having knobs that adjust
the angle of the game board, we will move the surface of
level of the game will require the player to navigate
more complicated mazes with more hazards. To make it
more interesting, we
ll also incorporate a timer element;
finish with time left and your score will be higher, run
out of time and you must replay the level.
In addition to the use of the accelerometer, this game
will require us to cover a number of concepts, including
Figure 15.5 A tabletop marble maze game—
the inspiration for an example of this chapter.
Simulated 3D effects