Name: __________________________________________
Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
Lesson 10 The Key to Adventure—Beta 159
Barrier Demolition
Another way to clear a barrier is to blow it up. This is more fun! The explorer happens
to be a demolition expert and gets to use dynamite to blow up the doors and other objects.
So cool! Note: the dynamite is also considered a passage key. You will do some advance
programming in a bit, but first get the basics done right.
15. In the Level 1 room, place an instance of the OBJ_Dynamite_Pack object somewhere
between the starting position and the doors, Figure 10-2.
16. Place the OBJ_Detonator_Up object in a place between the dynamite pack and the
doors. This should be in a place that will shield the avatar from the dynamite blast, like
behind a wall.
17. Open the Object Properties dialog box for the OBJ_Avatar object. You will program
this logic statement: IF the player presses the space bar, THEN create an instance of the
OBJ_Dynamite_Stick object at (16,–16) relative to the player. This will place a stick of
dynamite just above the avatar’s head.
18. Add an event for the player pressing the space bar.
19. Drag the Create Instance button from the Main 1 tab and drop it into the Actions:
column.
20. In the Create Instance dialog box, click the Self radio button, Figure 10-3.
21. Click in the Object: text box and select the dynamite stick object from the shortcut menu.
This is the object that will be created.
22. Enter 16 in the X: text box and –16 in the Y: text box.
23. Check the Relative check box and click the OK button to save the action.
24. Close the Object Properties dialog box, saving the changes.
Detonator Dynamic pack
Figure 10-2
Create
Instance
Previous Page Next Page