View Single Post
  #3  
Old 07-24-2004, 10:13 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Wtf? did my post get removed?
I'll rewrite it.

Maybe you should break after finding the npc?


NPC Code:
  if (npcs[this.i].x>x&&(abs(npcs[this.i].x-x)>abs(npcs[this.i].y-y))) {dir=3}
if (npcs[this.i].x<x&&(abs(npcs[this.i].x-x)>abs(npcs[this.i].y-y))) {dir=1}
if (npcs[this.i].y>y&&(abs(npcs[this.i].x-x)<abs(npcs[this.i].y-y))) {dir=2}
if (npcs[this.i].y<y&&(abs(npcs[this.i].x-x)<abs(npcs[this.i].y-y))) {dir=0}


You can use getdir() or the move option.
NPC Code:
  dir=getdir(npcs[this.i].x-x,npcs[this.i].y-y);



the move look unsmooth. use option 2.
__________________
-Kjetil Valen
Reply With Quote