Thread: Easy walker
View Single Post
  #7  
Old 10-10-2002, 10:54 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by Graal2001_NAT
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

This was just a quick demo for the staff, so I just put it together real quick.
__________________
[signature]insert here[/signature]
Reply With Quote