Thread: Easy walker
View Single Post
  #5  
Old 10-10-2002, 07:53 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
I like your way but why not do something like
NPC Code:

if (created) {
showcharacter;
}
if (mousedown){
dx = mousex-x;
dy = mousey-y;
dist=(dx^2+dy^2)^.5;
dir = (abs(dx)>abs(dy)? (dx>0? 3 : 1) : (dy>0? 2 : 0));
xinc = dx/dist;
yinc = dy/dist;
for(i=0;i<dist;i++){
x+=xinc;
y+=yinc;
setcharani walk,;
sleep .05;
}
setcharani idle,;
}


yes, no onwalls either
__________________
GONE, BAI
Reply With Quote