Game Development Reference
In-Depth Information
4.
Include a
Set Variable
action (
control
tab) that sets
speed
to
0
. These actions should
bring Zool to a complete and permanent halt.
5.
Include a
Play Sound
event (
main1
tab) that plays
snd_die
.
6.
Add an
Other, Animation End
event and include a
Set Variable
action (
control
tab)
that sets
visible
to
false
. This hides Zool once his dying animation is complete.
7.
Include a
Test Variable
action that checks if
lives
is
equal to
0
.
8.
Include a
Start Block
action.
9.
Include a
Set Variable
action that sets
lives
to
3
.
10.
Include a
Restart Room
action (
main1
tab) that uses
Fade out and in
to imply that it is
“Game Over.”
11.
Include an
End Block
action (
control
tab).
12.
Include an
Else
action.
13.
Include a
Start Block
action.
14.
Include a
Set Variable
action that sets
lives
Relative
to
-1
.
15.
Include a
Restart Room
action (
main1
tab) that uses
Interlaced from bottom
.
16.
Include an
End Block
action (
control
tab).
17.
Reopen
obj_zool
and add
an
Other, Room Start
event that includes a
Set Variable
action to set
health
to
3
. Zool will have three bars of health for each life.
18.
Create
an
Other, Game Start
event that includes a
Set Variable
action that sets
lives
to
3
. He will have three lives to begin with.
19.
Create a new object called
obj_health
(
Icons
group), give it
spr_icon_health
, and set
Depth
to
-2000
.
20.
Add a
Step, Step
event and include a
Test Variable
action to test if
health
is
equal to
0
.
21.
Follow this with another
Test Variable
action that tests if
obj_zool.state
is
NOT equal
to
ZSTATE_DEAD
(if you are using Game Maker Lite, then replace
ZSTATE_DEAD
with
10
).
22.
Follow this with a
Change Instance
action (
main1
tab) that
Applies to
the
Object
obj_zool
and changes into
obj_zool_dead
while performing events. We're handling
this in the health object rather than Zool again so that he only dies when a health
object is in the room.
23.
Add a
Draw
event and include a
Set Variable
action (
control
tab) that sets
x
to
view_xview[0]
.
24.
Include a
Set Variable
action that sets
y
to
view_yview[0]
.
Search WWH ::
Custom Search