Game Development Reference
In-Depth Information
Figure 7-29. Updated Target Destruction rule
You use a Timer here because you want to see the particles effects.
Knowing When the Target Has Been Destroyed
You will need another game attribute in order to know when the target has been
destroyed. Create a new Boolean game attribute named ''TargetDestroyed.''
Add a new Change Attribute behavior into the Timer you just created and
change game.TargetDestroyed to true, as shown in Figure 7-30.
Figure 7-30. TargetDestroyed is set to true
You will now know when the target has been destroyed; this indicates that it's
time to move to the next level and reposition the actors on the scene per their
next level coordinates. Let's do that.
Still in the instance of the Target actor, create a new rule named ''Level Up'' that
will meet the following two conditions:
''All''
''Attribute'' ''game.TargetDestroyed'' is ''true''
''Attribute'' ''game.Change Projectile'' is ''true''
Add the condition for the Change Projectile to be true in order to reset the scene
when the projectile goes back to the slingshot.
Drag and drop a Change Attribute behavior and change game.WhatLevel to
game.WhatLevel+1. This moves the level up.
Next, you will reposition the target. But before doing that, you need to ensure
that the target has no momentum movement. This would be a movement from
 
Search WWH ::




Custom Search