Game Development Reference
In-Depth Information
Drag and drop a Constrain Attribute behavior and change elastic right.Rotation
to vectorToAngle(game.ProjectileX - Current
Scene.Layers.Background.Slingshot Component Right.Position.X
,game.ProjectileY - Current Scene.Layers.Background.Slingshot Component
Right.Position.Y).
These behaviors are shown in Figure 6-21.
Figure 6-21. Elastic Right behaviors
Let's do the same for the left elastic.
Implementing the Left Elastic
Double-click the left elastic instance on the scene to open it in the Actor Editor.
Rename the instance actor to ''elastic left.'' Click the lock icon.
Drag and drop a Constrain Attribute behavior and change elastic
left.Position.Xto game.ProjectileX + (Current
Scene.Layers.Background.Slingshot Component Left.Position.X --
game.ProjectileX)/2.
 
Search WWH ::




Custom Search