Game Development Reference
In-Depth Information
Modifying the Parent Zool Object
1. Reopen obj_zool and select the Draw event again. Within the grouped actions for
FACE_RIGHT , include a new Test Variable action ( control tab) to check if the Variable
state is equal to the Value ZSTATE_JUMP .
2. Immediately follow this with a Draw Sprite action ( draw tab) to draw
spr_zool_jump_right at a Relative position of X = 0 , Y = 0 .
3. Follow this with another Test Variable action ( control tab) to check if the Variable
state is equal to the Value ZSTATE_FALL .
4. Immediately follow this with a Draw Sprite action ( draw tab) to draw
spr_zool_fall_right at a Relative position of X = 0 , Y = 0 .
5. Now use spr_zool_jump_left and spr_zool_fall_left to create left-facing equivalents
of these four new actions within the grouped actions for FACE_LEFT . The actions of the
Draw event should now look like Figure 3-11.
6. Select the Create event of obj_zool and edit the Change Instance action to Change
Into obj_zool_air rather than obj_zool_land .
If you try running the game now, then Zool should fall to the ground and run across it as you
would expect, but we really need to jump up to see the real effect of our new behaviors. This will
require some changes to the land state object.
 
Search WWH ::




Custom Search