Game Development Reference
In-Depth Information
''Attribute'' ''game.TargetDestroyed'' is ''true''
''Attribute'' ''game.Change Projectile'' is ''true''
Then, drag and drop a Timer and change the settings to ''After'' ''1'' seconds
with ''Run to Completion'' checked. Now drag and drop the No Movement
custom behavior in the timer. Drag and drop two Change Attributes into the
timer and change
Soft Block.Position.X to tableCellValue(game.Soft Block,
game.WhatLevel, 1)
Soft Block.Position.Y to tableCellValue(game.Soft Block,
game.WhatLevel, 2)
Drag and drop a Change Attribute behavior and change Hard Block2.NbHit to 0.
The last steps are to take care of the projectiles.
Modifying the Projectiles to Start a New Level
You will use the end of the re-positioning of the projectile to finish resetting your
parameters.
Open the instance of Projectile in the Actor Editor. Expand the Attributes reset
rule located in the Back to Position rule.
Drag and drop a Change Attribute behavior into the Attributes reset rule and
change game.TargetDestroyed to false.
Within the Back to Position rule, create a new rule that you will position on top
position. The condition is ''Attribute'' ''TargetDestroyed'' is ''true.'' Then drag
and drop a ''Change Attribute'' behavior in this rule and change
game.Attemptleft to 4. This will reset the number of attempts back to 4 when
you change levels.
The last modification you need make is to delay the repositioning because
putting the projectile back to its original position will reset the attributes. You
need to have the necessary time to reposition all the blocks.
Drag and drop a Timer behavior into the Back to Position rule and change the
settings to ''After'' ''0.2'' seconds with ''Run to Completion'' checked. Next, drag
and drop the rule and two behaviors into the Timer, as shown in Figure 7-36.
 
Search WWH ::




Custom Search