Game Development Reference
In-Depth Information
Figure 5-10.
The Step event for obj_bee
26.
Add an
Alarm, Alarm 0
event and include a
Test Variable
action that tests if
state
is
equal to
ESTATE_WAIT
.
27.
Include a
Start Block
action.
28.
Include a
Set Variable
action (
control
tab) that sets
state
to
ESTATE_MOVE
.
29.
Include a
Set Alarm
action (
main2
tab) that sets
Alarm 0
to
5
steps. This makes sure
that the bee only moves for five steps again (1/6 of a second).
30.
Include an
End Block
action (
control
tab).
31.
Include an
Else
action.
32.
Include a
Start Block
action.
33.
Include a
Set Variable
action that sets
state
to
ESTATE_WAIT
.
34.
Include a
Set Alarm
action (
main2
tab) that sets
Alarm 0
to
30
steps. This makes sure
that the bee waits for one second before moving again.
35.
Include an
End Block
action (
control
tab).
Space a few of the Bees around the level and check that they are working correctly. One of the
nice side effects of Game Maker's path finding (around
all objects
) is that the Bees also avoid
each other and sometimes end up buzzing round and round each other as they seem to fight to
face off against Zool. Give your game a thorough play test to make sure everything works just as it
should, and if you find any problems, then compare your version to
zool11.gmk
in the
Chapter05/Games
directory on the CD.
Search WWH ::
Custom Search