Game Development Reference
In-Depth Information
Figure 4-8. The actions for the Keyboard, Down event of the Zool wall state object
14. Next, add a Key Press, Space event to obj_zool_wall to allow Zool to release himself
from walls by jumping. Include a Speed Horizontal action ( move tab) with Horiz.
Speed set to -facing*2 . This applies a horizontal speed of 2 pixels per step in the
opposite direction to which Zool is facing.
15. Include a Speed Vertical action with Vert . Speed set to -15 . This will make Zool jump
upward as he leaps back from the wall.
16. Include a Change Instance action ( main1 tab) that will change into obj_zool_air and
Perform Events ( Destroy and Create ) as it does so.
17. Now add a Collision event with obj_solid and include a Set Variable action ( control
tab) that sets the Variable x to xprevious . This collision event will be similar to ones we
have used before, but not as complicated as the one for obj_zool_land .
18. Include a second Set Variable action that sets the Variable y to yprevious .
19. Include a Move to Contact action ( move tab) with Direction set to direction ,
Maximum set to -1 , and Against set to all objects .
20. Include a Move Fixed action with the middle Directions button selected and Speed set
to 0 . This creates the simpler kind of collision event, which is fine for climbing.
21. Include another Set Variable action ( control tab) with Variable set to state and Value
set to ZSTATE_CLING . This makes sure the climbing animation stops after a collision.
You should now have five actions for the Collision event, as shown in Figure 4-9.
 
Search WWH ::




Custom Search