Game Development Reference
In-Depth Information
Follow this with a Change Instance action to obj_zool_air and Perform events .
6.
7.
Follow this with an Exit Event action ( control tab).
8. Follow this with an End Block action.
Go on—give it a try and teach those stupid sweets a lesson. One of the nice side effects of the
damage mechanic is that when you are hurt by an enemy, you get launched into the air and
provided with the chance to get back at your enemy by landing on its head. Very satisfying! Don't
play the game for too long though—there are more ways to bother a sweet coming up.
Slide Kick
Being of ninja persuasion, Zool was not just limited to using his feet on the heads of his enemies
and it could often be more effective and satisfying to take out an entire row of enemies with a
sliding kick. This will be activated by holding down the down arrow key while running or skidding
on the ground. We've already paved the way for these with the new constants and Draw event
actions completed earlier. We will make use of a new variable to indicate that Zool is attacking
(either with a kick or a spin), as it will reduce the number of checks in different states.
Adding Kick Attack Behavior to Zool
1.
Reopen obj_zool , obj_zool_air , obj_zool_land , obj_zool_ice , and obj_zool_wall in
turn (that is, all of the Zool objects) and include a Set Variable action within each of
their Create events that sets the Variable attacking to false . This makes sure that Zool
is reset into a non-attacking mode whenever he changes state.
2.
Reopen obj_zool and select the Collision event with obj_enemy again and include a
Test Variable action immediately after the first End Block action. Use it to test if
attacking is equal to true .
3.
Immediately follow this with a Start Block action.
4.
Follow this with a Destroy Instance action ( main1 tab) with Applies to set to Other .
5.
Follow this with an Exit Event action ( control tab).
Follow this with an End Block action. The Collision event with obj_enemy should now
contain 23 actions, as shown in Figure 6-2.
6.
 
Search WWH ::




Custom Search