B
buddhajuggles
Guest
I am having an issue getting an enemy to play his death animation before he is destroyed.
if(CurrentHp <= 0 && sprite_index != spr_CrowFloor)
{
sprite_index = spr_CrowFloor;
// if(image_index == 3)
// {instance_destroy();}
}
if i set the image_ index == 0 the code works , the issue is that my animation is not playing past frame 0.
I added bit about sprite_index_ != to spr_CrowFloor incase the animation event was re starting itself.
the issue is present without it. I have also tried adding an annimation end event which only works as
well if I only use 1 frame of my animation. It is particularly frustrating because all my other animations
play through just fine. Incase it is due to some of the other code this is his step coding in its entirety ,the above code is below this.
image_xscale = -1;
if(I == true)
{
sprite_index = spr_EnemyHit1;
}
else {sprite_index = spr_enemy;}
if(OnGround == true)
{
GroundY = y;
}
depth = -1*GroundY;
thank you in advance.
if(CurrentHp <= 0 && sprite_index != spr_CrowFloor)
{
sprite_index = spr_CrowFloor;
// if(image_index == 3)
// {instance_destroy();}
}
if i set the image_ index == 0 the code works , the issue is that my animation is not playing past frame 0.
I added bit about sprite_index_ != to spr_CrowFloor incase the animation event was re starting itself.
the issue is present without it. I have also tried adding an annimation end event which only works as
well if I only use 1 frame of my animation. It is particularly frustrating because all my other animations
play through just fine. Incase it is due to some of the other code this is his step coding in its entirety ,the above code is below this.
image_xscale = -1;
if(I == true)
{
sprite_index = spr_EnemyHit1;
}
else {sprite_index = spr_enemy;}
if(OnGround == true)
{
GroundY = y;
}
depth = -1*GroundY;
thank you in advance.
Last edited by a moderator: