A health system with hearts

Godot Version



I am wondering how i could make a health system that uses hearts like ‘enter the gungeon’ or the classic zelda games? any help or advice would be much appreciated :slight_smile:

For those of us who are not familiar with the heart system for those games, can you elaborate on what you’re trying to achieve?

This would be my approach from the top of my head, you’d have to tweak it to make it work for your own needs:

  • I’d make sure the health variable is an int, so I have whole numbers.

  • Make sure there’s a signals that emits whenever the player health changes and passes the health value as an int.

  • For the UI I would not use a progress bar, but instead create an HBoxContainer.

  • Make a script with a function that takes an int value and instance that amount of heart icons inside the HBoxContainer.

  • Hook it up to the signal from the player’s health changing.

1 Like