Game Development Reference
In-Depth Information
Starting from the left side, open the second instance of the dummy projectile
and unlock it. Change the condition of the rule to
''Attribute''''game.Attemptleft''''<''''3,'' as shown in Figure 6-40.
Figure 6-40. Modifying dummy projectile two
Modifying the Projectile Instance
The next part of the work is to modify the projectile instance. You will need to
implement a detection when the projectile stops moving, which will trigger the
projectile to return to its original position. You will also reset the key attributes,
decrement the number of attempts, and implement a game reset when the four
attempts have been done. You will also use a Boolean attribute to set a state
when you change the projectile. This Boolean will be used as a condition in a
rule to trigger some resets.
Detecting when the Projectile Stops Moving
In the Scene Editor, create a new Boolean game attribute named ''Change
Projectile.'' To detect when the projectile stops moving, you will use the linear
velocity motion attributes.
Open the Projectile actor instance by double-clicking the actor on the scene.
Create a new rule into the Throwing rule and name it ''Change projectile.'' Add
the following conditions into the rule with the criteria ''All:''
''Attribute''''Projectile.Motion.Linear Velocity.X''''=''''0''
''Attribute''''Projectile.Motion.Linear Velocity.Y''''=''''0''
 
Search WWH ::




Custom Search