Page 1 of 1

Working out an angle

PostPosted: Tue Oct 28, 2008 8:24 pm
by akhad
I'm trying to get the angle between two points (actually Actor coords). I have one actor set at screen top, middle of the screen.
I then click along the base of the screen at a random X coord and a line is drawn (in the canvas) between the 2 points. I then require a sprite to move along the line,bottom to top. This sprite has a series of anim frames, the seq is of an arrow rotating through 270 degrees to 90 degrees. The movement part is easy, the MoveTo function can do this for one thing. However, I want to get the actual angle the actor will move at, which I will then use to work out which anim frame to set to represent the correct angle of the arrow. Make sense, anyone?

Re: Working out an angle

PostPosted: Tue Oct 28, 2008 11:20 pm
by makslane
Look the vectoradd tutorial here:
viewtopic.php?f=4&t=5719