Game Development Reference
In-Depth Information
Figure 6-18. Projectile, elastic, and slingshot arm
For the elastic, you will constrain its width to the distance between the projectile
and the right arm of the slingshot, giving the impression that the length is
changing (elastically) when moving the projectile. The position X3 is made by
adding half of the distance between X2 (the projectile) and X1 (the arm) to X2.
It's the same for Y3, which is made by adding half of the distance between Y2
and Y1 to Y2.
To finalize the effect, you will constrain the rotation of the elastic to the same
angle between the projectile and the arm of the slingshot. As you can see in
Figure 6-18, these two angles are equal.
Let's do all the above.
Creating the Elastic Actor
In the Scene Editor, create a new actor named ''Elastic.'' Change the attribute of
this actor as per Table 6-3.
 
Search WWH ::




Custom Search