It's not bad, but I noticed that the heart engine is way overcomplicated. Mine was much simpler. Let's see if I can find it . . .
Here it is, modified from a tutorial by goodnight (probably about 2/3 of my engine is based on something from goodnight.)
First, the heart engine object. There's no create event, only a draw event with this code:for (i=0; i<floor(global.totalhearts); i+=1)
draw_sprite(sprHUDHeart, min(max(global.hearts-i,0),1)*4, view_xview[0]+6+((i mod 10)*8), view_yview[0]+6+((i div 10)*8))
This is the point where I leave goodnight's tutorial and start my additions.
Then in objLink's create event, I added:global.hearts=3
global.totalhearts=3
global.heartpiece=0
And that's all. A .25 increment in global.hearts is a quarter heart. Unfortunately, It has no beating heart.
for a heart piece, the code should be:global.heartpiece+=1
if global.heartpiece=4{global.heartpiece=0
global.totalhearts+=1}
followed by whatever message you want to show. I haven't actually tested this myself, but it should work.
For a recovery heart (which you don't seem to have included) the collision event with objLink should be global.hearts+=1
instance_destroy()
if global.hearts>global.totalhearts{global.hearts=global.totalhearts}
You don't have to add all of this. It's just much more efficient. Unfortunately, it doesn't have a beating heart like yours does (I'm working with unregistered gm7 and can't be bothered to resprite the heart in different sizes.
I hope this was more or less understandable. I'm usually on the other end of the explanation.