177
Chapter 5 Collision Theory and Logic
The most used condition in video game design is
collision.
You may guess
the concept of
collision theory
deals with an object running into or hitting
another object. It does. However, also included in collision theory is the idea
that when objects collide the movements, animations, and events must provide
an illusion of reality.
One of the most difficult
concepts for beginning designers
to grasp is that a picture of an
item does not act the same as the
real item. When programming
a game, the fact that an object
looks like a wall does not make
it act like a wall. For it to act
like a wall, the object must be
programmed with the
properties
of a wall.
A good example of how an image is not a real object can be found in
cartoons. The old cartoon trick is to paint a black spot on the ground, as shown
in Figure 5-10. The black spot looks like a hole, but it is just paint and you
should be able to simply walk right over the top of the black spot. The key here
is interactivity.
Interactivity
is how one object behaves when it encounters
another object. In the cartoon, the interactivity is defined so the black spot
actually functions like a hole. When a character walks onto the black spot
(interacts with the hole), they fall into the hole.
Collision Theory
CHEAT CODE: PROPERTIES
Images used in video games are
programmed to work properly by
setting the object’s properties.
Visibility, interactivity, and movement
are some of the properties assigned to an object to make
it act like a real item.
Figure 5-9.
When a dart is used,
the computer looks at
the number of darts
to see if more than 0
darts are available.
Here, the result of the
test is
FALSE
since
the last dart has been
used. The computer
then initiates the
ELSE
operation to
display the game
over screen.
Goodheart-Willcox Publisher
Previous Page Next Page