I think, the while loop, for the walk-animation runs always (while(1)).

Create a flag for "alive" and set this onto false if the victim dies.

Code:
action victim1()
{
my.emask |= (ENABLE_IMPACT);
my.event = got_shot;
my.flag1 = true;
while(my.flag1)
{

c_move(my,vector(1*time_step,0,0),nullvector,0); // move ahead until obstacle is hit
wait(1);
}
}



function got_shot()
{
var anim_percentage = 0;
my.flag1 = false;
my.event = NULL; // the enemy is dead, so it should stop reacting to other bullets from now on
while (anim_percentage < 100) // this loop will run until the "death" animation percentage reaches 100%
{
ent_animate(my, "death", anim_percentage, NULL); // play the "death" animation only once
anim_percentage += 3 * time_step; // "3" controls the animation speed
wait (1);
}
set(my,PASSABLE); // allow the player to pass through the corpse now
}



Last edited by Steev; 07/23/08 12:19.

---
programming is a livestyle