Game Development Reference
In-Depth Information
Button
Double-click the Button actor to open it in the Actor Editor. Drag and drop the
''Positioning in the center'' behavior from the custom behavior inventory.
Seconds
Double-click the Seconds actor to open it in the Actor Editor. Drag and drop the
''Positioning in the center'' behavior from the custom behavior inventory.
Coming back to the strange size of the image compare to the visible arrow, the
trick is to implement a rotation of the actor per second. But the rotation attribute
rotates the actor from its center. So having an actor double the size of the arrow
provides the illusion that only the arrow is moving while in fact this is the
complete actor.
Drag and drop a Constrain Attribute behavior and change Seconds.rotation to
Devices.Clock.Seconds*6.
Why is there a minus sign? Chapter 2 discussed the way GameSalad measures
the angle: counter-clockwise. So in order to have a clockwise movement, you
need to make the seconds negative.
Also, the second arrows will cover the complete rotation in 60 seconds. A
complete rotation is 360 degrees. So the arrow should cover 6 degrees per
second (360/6).
The Seconds action view should match Figure 10-6.
 
Search WWH ::




Custom Search