173
Chapter 5 Collision Theory and Logic
Several game design tools
use the term trigger to describe a
condition. A
trigger
is programming
for when a condition is met that a
series of actions will begin. In the
case of a logic statement, the trigger
is the
IF
(condition) and the actions
it initiates are the THEN. A single
condition can act as the trigger for
several different actions to begin or
end as described in the next section.
Advanced Logic Statements
The next step in basic
programming is to add multiple
actions or multiple reactions to logic
statements. This is done using the
AND
and
OR
operators. These operators work
just as they would as conjunctions in
any sentence. The
AND
operator will
join two or more outcomes for a given
condition or action. Refer to Figure 5-5:
Figure 5-5.
Goodheart-Willcox Publisher
The action of the dart hitting the balloon
creates the reaction of the balloon
disappearing, an explosion appearing, and
the score changing by 100 points. The balloon
does not actually “pop.” To create the illusion
of popping, the balloon object is destroyed
and replaced by a popping animation.
Figure 5-4.
Goodheart-Willcox Publisher
This illustration shows logical statements for a player using the arrow
keys to move a character.
Previous Page Next Page