Game Development Reference
In-Depth Information
Figure 4-13. The actions for the Keyboard, Left event of the Zool wall state object
20. Repeat steps 14-19 to create a similar Keyboard, Right event that checks that facing is
equal to FACE_LEFT and sets it to FACE_RIGHT .
Try out this latest version and see what a difference it makes. Zool should now spring neatly
off the top and bottom of walls, as well as being able to walk into them and walk away again
without needing to jump. This works pretty well now and you will find this version of the game in
the file Zool4.gmk in the Chapter04/Games directory on the CD.
Ramping Up
All is well and good for horizontal and vertical surfaces in the game, so it's about time we tackled
those slopes and ramps. Ramps are actually not too difficult to add, so we'll do those first. There
are currently no ramp collision objects placed on the level (that's why you can walk straight
through the ramp tiles), so you're going to need to add these first.
Placing Ramp Collision Objects in the Room
1.
Reopen room_test , make sure that the objects tab is selected, and scroll to the position
of the first ramp that slopes gently up and down again. Now turn off Show Tiles (next
to the magnifying glass) and all the tiles should disappear to reveal that there is just a
flat row of obj_platform collision objects beneath where the ramp tiles are.
2.
Turn Show Tiles back on and carefully right-click on the two squares marked with blue
crosses in the top left panel of Figure 4-14. This will delete the collision objects that are
currently hidden behind the tiles and mark the boundaries of the ramp for you, as
shown in the middle left panel.
 
Search WWH ::




Custom Search