Game Development Reference
In-Depth Information
25.
Include a
Set Variable
action that sets
unit
to
0
.
26.
Include a
Repeat
action that repeats the following block of actions
health
Times
.
27.
Include a
Start Block
action.
28.
Include a
Draw Sprite
action (
draw
tab) for
spr_icon_health
at the
Relative
position of
X
=
224+(32*unit)
,
Y
=
20
.
29.
Include a
Set Variable
action (
control
tab) that sets
unit
Relative
to
1
.
30.
Include an
End Block
action.
31.
Create a new object (
Icons
group) called
obj_lives
, give it the
spr_icon_lives
Sprite,
and set its
Depth
to
-2000
.
32.
Add a
Draw
event and include a
Set Variable
action that sets
x
to
view_xview[0]
.
33.
Include a
Set Variable
action that sets
y
to
view_yview[0]
.
34.
Include a
Draw Sprite
action (
draw
tab) for
spr_icon_lives
at the
Relative
position of
X
=
490
,
Y
=
280
.
35.
Include another
Draw Sprite
action for
spr_icon_digits
at the
Relative
position of
X
=
460
,
Y
=
280
and
Subimage
of
lives
. This will draw the appropriate digit for the
number of lives Zool has left.
36.
Finally, reopen
obj_controller
and include a
Create Instance
action (
main1
tab) in its
Create
event that creates an instance of
obj_health
.
37.
Include another
Create Instance
action that creates an instance of
obj_lives
.
Zoolaphobia
Unbelievably, there is just one final action to add to our game to complete it—so what are we
missing? Well, the original Zool had some brilliantly wacky music tracks to accompany the game
that were ably composed by Patrick Phelan on the music tracker systems of the day. Patrick's
auntie actually worked at the Bassets sweet factory in Sheffield, so it's nice to think that this
music might have been written after consuming a particularly large amount of free Jelly Babies. It
fits the game perfectly and brings our current journey to a fitting conclusion.
Adding Music to the Game
Create a new Sound resource using the file
snd_music
from the
Chapter06/Resources
directory on the CD.
1.
2.
Reopen
obj_zool
and select the
Game Start
event. Include a
Play Sound
action (
main1
tab) to play
snd_music
with
Loop
set to
true
. Enjoy!
Search WWH ::
Custom Search