Graphics Reference
In-Depth Information
To do this, you add logic to the Empty object as shown in Figure 15-28 . This logic has a Random sensor
timed to emit once every 100 frames on average. It triggers a Message actuator with the subject line switch .
In turn, the sensor shown in Figure 15-29 will fire when this message is emitted. In the final bad-guy motion
logic, this random message triggers an increment or decrement in the targ value, depending on whether the
bad guy is already moving in an incrementing or decrementing direction.
Figure 15-28 Random “switch” message on the Empty object
Figure 15-29 Bad-guy Message sensor
The full bad-guy motion logic is shown in Figure 15-30 . It is very much like the logic explained previously,
except that logic is added for the cases in which the bad guys are traveling in the reverse (decrementing) direc-
tion around the path. There are too many logic bricks here to show them all unfolded, and furthermore, as you
cansee,thelogicbricksherearealreadypushingthelimitsofwhatlogicalconnectionscanbeeasilyunderstood
ataglance.Irecommend thatyoutakeacloselookatthefile game.blend onthewebsiteforthisbookifyou
need further insight into how this logic works.
 
 
 
 
 
Search WWH ::




Custom Search