player: display health in HUD

This commit is contained in:
Jeremy Baxter 2026-01-22 20:54:21 +13:00 committed by jeremy
parent df449af0f3
commit 47aa5ac9aa

View file

@ -25,11 +25,13 @@ func resize_ui():
$HUD.position.y = size.y - hud_h
func make_hud():
var text = "Holding " + $Pivot/Container/Gear.gear_name()
var text = ""
for node in $Backpack.get_children():
if not node is Gear:
continue
text += "\n%s (%s)" % [node.gear_name(), node.name]
text += "%s (%s)\n" % [node.gear_name(), node.name]
text += "Holding " + $Pivot/Container/Gear.gear_name() + "\n"
text += str(health) + " hp"
$HUD.text = text
func message(string):