Game Development Reference
In-Depth Information
Implementing the Right Elastic
Double-click the right elastic instance on the scene to open it in the Actor Editor.
Rename the instance actor to ''elastic right.'' Click the lock icon shown in Figure
6-20. This will unlock the instance behaviors.
Figure 6-20. Unlock the instance of actor
Drag and drop a Constrain Attribute behavior and change elastic right.Position.X
to game.ProjectileX + (Current Scene.Layers.Background.Slingshot Component
Right.Position.X ---- game.ProjectileX)/2.
Drag and drop a Constrain Attribute behavior and change elastic right.Position.Y
to game.ProjectileY + (Current Scene.Layers.Background.Slingshot Component
Right.Position.Y ---- game.ProjectileY)/2.
Drag and drop a Constrain Attribute behavior and change elastic
right.Size.Width to magnitude(Current Scene.Layers.Background.Slingshot
Component Right.Position.X ---- game.ProjectileX ,Current
Scene.Layers.Background.Slingshot Component Right.Position.Y ----
game.ProjectileY).
 
Search WWH ::




Custom Search