Game Development Reference
In-Depth Information
Then, drag and drop a Change Attribute behavior into the rule and change
Projectile.Color.Alpha to 0. Next, drag and drop a Change Attribute behavior
into the same rule and change game.Change Projectile to true. Last, drag and
drop a last Change Attribute behavior into the rule and change game.Attemptleft
to game.Attemptleft -1. The rule is shown in Figure 6-41.
Figure 6-41. Change Projectile rule
Moving Back to the Original Position
You will move the projectile back to its original position via a rule when the
attribute Change Projectile is true. Use the Interpolate behavior to move it back
to its original position, which is stored in the attributes InitialProjectileX and
InitialProjectileY.
Create a new rule in the Projectile actor instance and name it ''Back to
Position.'' The condition of the rule is ''Attribute''''game.Change
Projectile''''is''''true.'' Drag and drop an Interpolate behavior into the rule and
change the settings to:
Interpolate Attribute: Projectile.Position.X
To: game.InitialProjectileX
Duration: 1
Function: Linear
 
Search WWH ::




Custom Search