Thread: angle of player
View Single Post
  #2  
Old 08-17-2003, 05:53 AM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
Re: angle of player

Quote:
Originally posted by jake13jake
I've been trying to script a kind of vortex that pulls with a spiraling effect. I've been able to get around several problems, but I just hit a wall. The problem is I don't know how to get the players angle. Someone suggested using getangle, but I don't quite know how it works very well. Another person sent me a whole mess of equations, which I doubt would work, but if it were to I wouldn't know the right function for inverse tangent.

first person said:
angle = getangle(playerx-centerx,playery-centery)

second person said:
prime = tan-((playery-centery)/(playerx-centerx));
if ((playerx-centerx)>=0 && (playery-centery)>=0) {angle = prime;}
if ((playerx-centerx)<=0 && (playery-centery)>=0) {angle = 180 - prime;}
if ((playerx-centerx)<=0 && (playery-centery)<=0) {angle = 180 + prime;}
if ((playerx-centerx)>=0 && (playery-centery)<=0){ angle = 360 - prime;}

Does anyone have a clue as to so they can help me out a little?
This is Kai/Giltwist zone. I will IM Giltwist the link.
__________________
(Married to Skyld)
Reply With Quote