Game Development Reference
In-Depth Information
Figure 15.4 The accelerometer
values for the iPhone when it
is fully upright and facing you.
acceleration
X
=
0, acceleration
Y
=
1, acceleration
Z
=
0
acceleration
X
=
0, acceleration
Y
=
1, acceleration
Z
=
0
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
thephoneitselftosimulatetheverysameeffect.Each
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
the following:
1.
'
Technical
a.
Collision detection
b.
Timers
Figure 15.5 A tabletop marble maze game—
the inspiration for an example of this chapter.
c.
Simulated 3D effects
Search Nedrilad ::




Custom Search