Game Development Reference
In-Depth Information
Open the instance Hard Block1 in the Actor Editor. Create a new rule and
rename it ''Level Up.'' The triggers for this rule are the two attributes
TargetDestroyed and Change Projectile set to true. So modify the conditions to:
''All''
''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. You use a Timer before re-positioning the
blocks to ensure that the projectile has enough time to fly out of the scene. If
you don't wait, a collision may occur that could mess your gameplay.
Now drag and drop the No Movement custom behavior into the Timer.
Drag and drop two Change Attributes into the Timer and change:
Hard Block1.Position.X to tableCellValue(game.Hard Block1,
game.WhatLevel, 1)
Hard Block1.Position.Y to tableCellValue(game.Hard Block1,
game.WhatLevel, 2)
You will also need to reset the number of hits for the block. Drag and drop a
Change Attribute behavior and change Hard Block1.NbHit to 0.
The Level Up rule for Hard Block1 is shown in Figure 7-35.
Search WWH ::




Custom Search