slicky-grease
Member
I have this enemy object in which when after his health is depleted, he will recoil back and then hit the ground. I got the code to work somewhat to a certain extent. For some reason, his death animation will play before the hit sprite and sometimes the hit sprite will play before the death. I need his hit sprite to play before his death all the time.
GML:
//Enemy Dead
if ( hp <= 0)
{
if dead = false
{
vsp = -4
hsp = 3
obj_player.meter += 25
dead = true
state = enemy.hit
sprite_index = spr_grunthit
}
if place_meeting(x,y+1,obj_wall)
{
hsp = 0
sprite_index = spr_gruntdead
image_speed = 1
state = enemy.dead
}
}