
02-09-2010, 06:06 PM
|
|
Will work for food. Maybe
|
 |
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
|
|
|
First find the delta like so:
temp.dx = ((player.x+1.5) - (npc.x+1.5));
temp.dy = ((player.y+2) - (npc.y+2));
The offset is 1.5x2, which is the center of the player objects. If the NPC is not a player character and has a different body shape, you'll want to adjust that accordingly.
Then use the getangle() function:
getangle(dx,dy);
By the by, Graal uses radials(0-pi*2) and not degrees(0-360). |
|
|
|