Game Development Reference
In-Depth Information
Figure 6-9. Using the magnitude and vectorToAngle functions
With your finger, you will touch the projectile and pull it back. When the touch is
released, you will use a Change Velocity for the direction, which will depend on
the vectorToAngle value, and the speed, which will depend on the magnitude.
Using the mouse position when the touch is pressed, you will constrain the
position of the projectile. But you don't want the projectile to be outside of the
circle shown back in Figure 6-6.
Creating the Projectile
In the Scene Editor, create a new actor and named it ''Projectile.'' Change the
attributes of the actors as per Table 6-2.
 
Search WWH ::




Custom Search