Game Development Reference
In-Depth Information
6.
Follow this with a
Set Variable
action that sets the
Variable
facing
to
-facing
.
7.
Include a
Check Object
action that checks if there would
NOT
be a collision with an
instance of
obj_platform
at a
Relative
position of
X
=
0
,
Y
=
1
.
8.
Follow this with an
Execute Script
action that sets
Script
to
move_to_contact_with
,
Argument0
to
270
,
Argument1
to
-1
, and
Argument2
to
obj_platform
. This will move
the Jelly down when descending slopes.
9.
Include a
Change Sprite
action (
main1
tab) that sets the
Sprite
to
spr_jelly
,
Subimage
to
-1
(unchanged), and
Speed
to
0.2
. This provides a default state for the
sprite and reduces the animation speed to a fifth because the wobble animation only
has two frames and was running much too fast.
10.
Include a
Check Object
action (
control
tab) that checks if there would be a collision
with an instance of
obj_ramp_up
at a
Relative
position of
X
=
0
,
Y
=
1
(that is, directly
underneath the Jelly).
11.
Follow this with a
Change Sprite
action (
main1
tab) that sets the
Sprite
to
spr_jelly_up
, the
Subimage
to
-1
, and the
Speed
to
0.2
again.
12.
Include another
Check Object
action (
control
tab) that checks if there would be a
collision with an instance of
obj_ramp_down
at a
Relative
position of
X
=
0
,
Y
=
1
.
13.
Follow this with a
Change Sprite
action (
main1
tab) that sets the
Sprite
to
spr_jelly_down
, the
Subimage
to
-1
, and the
Speed
to
0.2
. The
Step
event for
obj_jelly
should now contain 14 actions, as shown in Figure 5-5.
Figure 5-5.
The Step event of obj_jelly
Search WWH ::
Custom Search