Game Development Reference
In-Depth Information
Figure 6-6. Area of Pullback of the block
A circle will define this area. The radius of the circle will be the maximum of the
force of the pullback. You will use a game attribute to store this maximum value;
name it ''MaxPower.''
Before building this pullback, let's look at two new functions of GameSalad:
magnitude and vectorToAngle.
magnitude Function
magnitude is a function that calculates the distance between two actors, as
shown in Figure 6-7. The syntax of the function is magnitude (Actor1X-Actor2X,
Actor1Y-Actor2Y)
Figure 6-7. Distance between two actors
 
Search WWH ::




Custom Search