PDA

View Full Version : Arctan



Joe123
09-03-2008, 12:37 PM
*sigh*
And I come for help again >_<


void Beam1(int x,int y){
lweapon Beam1 = Screen->CreateLWeapon(31);
Beam1->Tile = Beam1Tile;
Beam1->CSet = Beam1CSet;
Beam1->Step = 3;
Beam1->Damage = Beam1Damage;
Beam1->X = 120;
Beam1->Y = 0;
Beam1->Angular = true;
Beam1->Angle = ArcTan((x-Beam1->X),(y-Beam1->Y));
}
This seems to only work in the bottom 'quarter'.
Why should that be?
I can't see anything wrong with the code...

EDIT:
Ok, nevermind.

void Beam1(int x,int y){
lweapon Beam1 = Screen->CreateLWeapon(31);
Beam1->Tile = Beam1Tile;
Beam1->CSet = Beam1CSet;
Beam1->Step = 3;
Beam1->Damage = Beam1Damage;
Beam1->X = 120;
Beam1->Y = 2;
Beam1->Angular = true;
Beam1->Angle = ArcTan((x-Beam1->X),(y-Beam1->Y));
}
Appears to work ok.