View Single Post
  #3  
Old 05-17-2008, 12:06 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
I tried:

PHP Code:
temp.dx = DragItem.x - player.x;
temp.dy = DragItem.y - player.y;
player.dir = getdir(temp.dx, temp.dy); 
It only works when the DragItem is far away from the player.

EDIT: SOLVED!!!

PHP Code:
temp.sx = screenx(player.x,player.y);
temp.sy = screeny(player.x,player.y);
temp.dx = DragItem.x - temp.sx;
temp.dy = DragItem.y - temp.sy;
player.dir = getdir(temp.dx, temp.dy); 
This fixed it.

Last edited by Stryke; 05-17-2008 at 12:16 AM.. Reason: SOLVED
Reply With Quote