PHP Code:
// for player direction
getangle(vecx(temp.obj.dir), vecy(temp.obj.dir));
// to a target
getangle((this.x - temp.tx), (this.y - temp.ty));
// to the mouse
getangle((mousex - temp.tx), (mousey - temp.ty));
Well.... to the point:
PHP Code:
getangle((temp.tx - this.x), (temp.ty - this.y));
Change it into:
PHP Code:
getangle((this.x - temp.tx), (this.y - temp.ty));