Game Development Reference
In-Depth Information
5.
Include a
Change Sprite
action (
main1
tab) with
Sprite
set
to
spr_lava_begin
,
Subimage
to
0
, and
Speed
to
0.5
. This will slow the lava sprite's animation down by
half.
6.
Include a
Check Empty
action (
control
tab) that checks that there wouldn't be a
collision if this instance was placed 32 pixels to the left of its current position (set
X
to
-
32
,
Objects
to
all
,
and check the
Relative
option).
7.
Include a
Create Instance
action (
main1
tab) that creates an instance of
obj_rock_begin
32 pixels to the left of the current object (Set
X
to
-32
and check the
Relative
option).
8.
Create a new object called
obj_lava_end
. Select the
spr_lava_end
sprite and set
obj_hazard
as the parent of this object.
9.
Add a
Create
event to
obj_lava_end
.
10.
Include a
Change Sprite
action (
main1
tab) with
Sprite
set
to
spr_lava_end
,
Subimage
to
0
, and
Speed
to
0.5
.
11.
Include a
Check Empty
action (
control
tab) that checks that there wouldn't be a
collision if this instance was placed 32 pixels to the right of its current position (set
X
to
32
,
Objects
to
all
,
and check the
Relative
option).
12.
Include a
Create Instance
action (
main1
tab) that creates an instance of
obj_rock_end
32 pixels to the right of the current object (set
X
to
32
and check the
Relative
option).
Creating the Middle Lava Object and Its Create Event
1.
Create a new object called
obj_lava_middle
. Select the
spr_lava_middle
sprite and set
obj_hazard
as the parent of this object.
2.
Add a
Create
event to
obj_lava_middle
.
3.
Include a
Change Sprite
action (
main1
tab) with
Sprite
set
to
spr_lava_middle
,
Subimage
to
0
, and
Speed
to
0.5
.
4.
Include a
Check Object
action (
control
tab) that checks if there would
not
be a
collision with an instance of
obj_hazard
if the lava instance was placed 32 pixels to the
right of its current position (Set
X
to
32
and check both the
Relative
and
NOT
options).
5.
Include a
Start Block
action (
control
tab) to group together the following actions.
6.
Include a
Change Instance
action (
main1
tab) that changes into
obj_lava_end
with
Perform Events
set to
yes
.
7.
Include an
Exit Event
action (
control
tab). This stops the remaining actions in the
event from being executed.
8.
Include an
End Block
action (
control
tab) to mark the end of the grouped actions.
9.
Include a
Check Object
action (
control
tab) that checks that there would
not
be a
collision with an instance of
obj_hazard
if the lava instance was placed 32
pixels to the
left of its current position (set
X
to
-32
and check both the
Relative
and
NOT
options).
10.
Include a
Start Block
action (
control
tab) to group together the following actions.
11.
Include a
Change Instance
action (
main1
tab) that changes into
obj_lava_begin
with
Perform Events
set to
yes
.
Search WWH ::
Custom Search