Game Development Reference
In-Depth Information
Adding a Create Event for the Rock Middle Object
1.
Reopen the Object Properties for
obj_rock_middle
by double-clicking on it in the
resource list.
2.
Click on the
Add Event
button and select the
Create
event.
3.
Click on the
control
action tab on the far right of the Object Properties form and drag
the
Check Empty
action into the actions
list.
In the
Check Empty
properties form, set
X
to
32
and leave
Y
set to
0
. Set
Objects
to
all
and make sure that the
Relative
option is checked. This checks that there wouldn't be
a collision if this instance was placed 32 pixels to the right of its current position. This
is a conditional action (hexagonal in shape) and the action(s) immediately following it
will only take place if this action evaluates to true. Click
OK
to close the
Check Empty
properties form.
4.
5.
Select the
main1
action tab and drag the
Change Instance
action into the actions
list.
Click on the menu icon at the end of the
Change Into
field and select
obj_rock_end
from the list. Also, set
Perform Events
to
yes
. This will turn the middle platform section
into an end platform section if the previous check was true. In other words, a rock
middle will be turned into a rock end when it is at the right-most end of a length of
platform.
6.
Repeat steps 3-5, this time checking 32 pixels to the left and creating
obj_rock_begin
(so you will need to use an
X
value of
-32
). Make sure that the left
Check Empty
is
followed by the
Change Instance
for
obj_rock_begin
and the right
Check Empty
is
followed by the
Change Instance
for
obj_rock_end
. You can rearrange the order of
actions in the actions
list by clicking and dragging them within the list.
7.
Your list of actions should now look like the one shown in Figure 2-7. Click the
OK
button in the bottom left to close the Object Properties form.
Figure 2-7.
The actions for the create event of the middle rock object
Search WWH ::
Custom Search