Game Development Reference
In-Depth Information
6.
Select the
End Step
event and include all the following actions above the existing ones.
7.
Include a
Test Variable
action that tests if the
Variable
state
is
equal to
ZSTATE_STAND
.
8.
Immediately follow this with another
Test Variable
action that tests if the
Variable
speed
is
larger than
SKID_SPEED
. This will ensure that the following actions will only be
executed if Zool is standing but still moving quite fast—that is, he has just stopped
running and friction hasn't brought him to a standstill yet.
9.
Include a
Start Block
action.
10.
Include a
Set Variable
action that sets the
Variable
state
to the
Value
ZSTATE_SKID
.
11.
Include a
Play Sound
action (
main1
tab) to play
snd_skid
with
Loop
set to
false
.
12.
Include an
End Block
action (
control
tab). This covers switching into the skid state, so
now we need to make sure that it goes back to standing again afterwards.
13.
Include a
Test Variable
action that tests if the
Variable
state
is
equal to
ZSTATE_SKID
.
14.
Immediately follow this with another
Test Variable
action that tests if the
Variable
speed
is
smaller than
1
.
15.
Follow this with a
Set Variable
action that sets the
Variable
state
to the
Value
ZSTATE_STAND
. The
End Step
event of
obj_zool_land
should now contain the 25 actions
shown in Figure 4-21. Give yourself a round of applause!
And that's it—you can now skid Zool around the test level to your heart's content. Give the
game a really good play-test to iron out any mistakes, or alternatively you can use the file
zool6.gmk
in the
Chapter04/Games
directory on the CD.
Search WWH ::
Custom Search