Code:
var distance = 0;
while(1)
{ 

if(vec_dist(my.x, your.x)>= 100)
{
distance =-3*time_step;
c_move(me, vector(0,distance,0), NULL, GLIDE);
my.ANIMATION += 2* distance;
ent_animate(my,"walk",my.ANIMATION,ANM_CYCLE);
}
else
{
my.ANIMATION = 0;
my.ANIMATION += 25 * time_step; 
ent_animate(my, "attack", my.ANIMATION,ANM_CYCLE); 
}

wait(1);
}


You need to calculate the distance every frame, so it goes inside the while loop.

Last edited by DJBMASTER; 01/21/10 05:48.