Game Development Reference
In-Depth Information
About Apple:
The very first Apple logo was actually a representation of Sir Isaac
Newton sitting under an apple tree with an apple falling on his head. It
is said that the Apple name was an homage to Sir Newton.
Flying and Dragging
Personally I do not use the GameSalad gravity feature. It is located within the
scene attributes. You can enter a real number on X and Y that will simulate a
force in the X and Y direction.
As gravity is an acceleration, instead I prefer to use the Accelerate behavior. It
gives more flexibility because you can trigger it through rules. Imagine having a
space scene with several planets, each having their own gravity…
Implement the gravity and drag it into your project. Drag is used to simulate the
friction of the air for an object. Drag is an attribute of an actor.
Open the Projectile actor in the Actor Editor. Expand the Otherwise section of
the Touch rule. Then, drag and drop an Accelerate behavior into the Throwing
rule. Change the settings to:
Direction: 270
Relative to: scene
Acceleration: 200
This will simulate the gravity.
Then, drag and drop a Change Attribute behavior next to the Accelerate
behavior. Change Projectile.Physics.Drag to 100. Figure 6-29 shows these two
behaviors. This drag will simulate the air friction.
 
Search WWH ::




Custom Search