Game Development Reference
In-Depth Information
Figure 6-10.
The actions that make up the Step event of obj_collect_count
16.
Select the
Draw
event.
17.
Edit the third
Set Variable
action that sets
digit
to
6
and set it to
2
instead. We'll
represent numbers under 10% with a 0 at the start.
Follow this with a new
Test Variable
action that tests if
collect_percent
is
equal to
100
.
18.
Follow this with a new
Set Variable
action that sets
digit
to
3
. We'll use an extra digit
to represent 100%.
19.
Edit the next
Set Variable
action for
text_string
and replace
score
with
collect_percent
.
20.
Edit the first
Draw Sprite
action for
spr_icon_score
and set it to draw
spr_icon_collect
at a
Relative
position of
X
=
25
,
Y
=
280
and
Subimage
image_index
.
21.
22.
Include a new
Draw Sprite
action (
draw
tab) immediately before the
Repeat
action
that draws
spr_icon_percent
at a
Relative
position of
X
=
56+(16*digit)
,
Y
=
280
.
Edit the final
Draw Sprite
action for
spr_icon_digits
and change the position to
X
=
40+(16*digit)
,
Y
=
280
. The
Draw
event for
obj_collect_count
should now contain
the 15 actions shown in Figure 6-11.
23.
Search WWH ::
Custom Search