Game Development Reference
In-Depth Information
Drag and drop a Constrain Attribute behavior and change elastic left.Position.Y
to game.ProjectileY + (Current Scene.Layers.Background.Slingshot Component
Left.Position.Y -- game.ProjectileY)/2.
Drag and drop a Constrain Attribute behavior and change elastic left.Size.Width
to magnitude(Current Scene.Layers.Background.Slingshot Component
Left.Position.X -- game.ProjectileX ,Current Scene.Layers.Background.Slingshot
Component Left.Position.Y -- game.ProjectileY).
Drag and drop a Constrain Attribute behavior and change elastic left.Rotation to
vectorToAngle(game.ProjectileX - Current Scene.Layers.Background.Slingshot
Component Left.Position.X ,game.ProjectileY - Current
Scene.Layers.Background.Slingshot Component Left.Position.Y).
These behaviors are shown in Figure 6-22.
Figure 6-22. Elastic Left behaviors
Hit the Preview button to play with the projectile.
You can open the file CanonShowPartI-step1.gameproj located in the folder
Chapter6_Files.
 
Search WWH ::




Custom Search