Results 1 to 1 of 1
Thread: Little Help please with angles
Sep 6, 2008, 14:17 #1
- Join Date
- Mar 2006
- 0 Post(s)
- 0 Thread(s)
Little Help please with angles
I have the character moving around my page.
If you go to http://liveanime.org/rpg/ you will understand better.
If you click to the left of the character the gif that walks left will show, and if you click right of the character the gif that walks right will show. Now my problem is walking up and down.
The basis of this problem is maths. I have the current x and y position of the character and the x and y position of where he will end up. I use pythag to work out that distance, now i would like to work out the angle of the line from where the character is to where hell end up.
Triganometry... lol, while i need no code, just some sudo code/equations...
i would like the "upwards" gif to show if (using directly right as 0 degrees and increasing clockwise) the angle is between 225-315 degrees and the "downward" gif if the angle is between 45-135.
an image to help expalin.
any help really apreciated.
(if you want to test out whats there so far the only thing you can do, is move about and kill the enemy in the bottom right lol)