The last time I did a zelda heart-styled HP system I took the lazy route because I argue with for loops too much. Made a sprite with 4 subimages, 1 for each heart "quarter".
And then something like
DRAW EVENT
if life > 0
{if life > 3 draw_spritxt(spr_hud_hp,3,view_xview[0]+xx,view_yview[0]+yy,1,1,0,-1,1)
else draw_spritxt(spr_hud_hp,life-1,view_xview[0]+xx,view_yview[0]+yy,1,1,0,-1,1)
}
if life > 4
{if life > 7 draw_spritxt(spr_hud_hp,3,view_xview[0]+xx+20,view_yview[0]+yy,1,1,0,-1,1)
else draw_spritxt(spr_hud_hp,life-5,view_xview[0]+xx+20,view_yview[0]+yy,1,1,0,-1,1)
}
that's two hearts, no STEP EVENT interference.
I made that off top of my head so probably isn't reliable, and I don't suggest using it without testing.
And then something like
DRAW EVENT
if life > 0
{if life > 3 draw_spritxt(spr_hud_hp,3,view_xview[0]+xx,view_yview[0]+yy,1,1,0,-1,1)
else draw_spritxt(spr_hud_hp,life-1,view_xview[0]+xx,view_yview[0]+yy,1,1,0,-1,1)
}
if life > 4
{if life > 7 draw_spritxt(spr_hud_hp,3,view_xview[0]+xx+20,view_yview[0]+yy,1,1,0,-1,1)
else draw_spritxt(spr_hud_hp,life-5,view_xview[0]+xx+20,view_yview[0]+yy,1,1,0,-1,1)
}
that's two hearts, no STEP EVENT interference.
I made that off top of my head so probably isn't reliable, and I don't suggest using it without testing.