Nice forum! Had a question for codemonkey or whoever know the answer. In the pool table tutorial, how did you make controls for aiming and shooting the cue ball?
I used the position of the cue ball that I click on and the position of the mouse as points of reference.
With those I can find the angle using the vectorToAngle function, and the power based on the magnitude with a min function to limit the power. The magnitude can also be used to determine the length of the helper tool.
With the angle and magnitude, using sin/cos of the angle and multiple it by the magnitude, you can find the x/y position of the arrow, respectively.
That is the short of it. I'm a bit tired right now.
I've started a section in http://gamesalad.com/wiki/tutorials called CodeMonkey's Tutorial Games All the vital stuff from the pool table game, but no explaination yet.
Comments
With those I can find the angle using the vectorToAngle function, and the power based on the magnitude with a min function to limit the power. The magnitude can also be used to determine the length of the helper tool.
With the angle and magnitude, using sin/cos of the angle and multiple it by the magnitude, you can find the x/y position of the arrow, respectively.
That is the short of it. I'm a bit tired right now.
All the vital stuff from the pool table game, but no explaination yet.