Posted By: Anonymous
animate while player gets hurt... - 02/20/10 20:52
hi again!
i want the player to play this hurt animation if he gets hurt by the enemy. this is the part i use in the enemy action:
and this is the "player_damage" function i call in the playe_action:
Problem: The animation wont play
i know there is something wrong, i tried some, but nothing worked. can u help??
i want the player to play this hurt animation if he gets hurt by the enemy. this is the part i use in the enemy action:
Code:
action enemy_fight3 // attached to the enemy { while(!player) { wait(1); } ... ent_vertex(my.sword_tip, 1840); ent_vertex(my.sword_base, 306); trace_mode = ignore_me + ignore_passable; trace (my.sword_base, my.sword_tip); if (result != 0) { //my.enable_impact = on; my.event = player_damage; effect (particle_blood, 2, target, normal); if (you != null) {you.health -= 2 * time;} ent_playsound (my, zombie_wav, 50); } ent_cycle("attack", my.skill20); my.skill20 += 5 * time; wait (1); ...
and this is the "player_damage" function i call in the playe_action:
Code:
function player_damage() { if (you == player) { ent_animate(my, "hurt", my._animdist, null); my._animdist += 3 * time_step; // "3" controls the animation speed wait (1); } }
Problem: The animation wont play
i know there is something wrong, i tried some, but nothing worked. can u help??