player: display health in HUD

This commit is contained in:
Jeremy Baxter 2026-01-22 20:54:21 +13:00
parent 2a6f04053c
commit 5b8d7fdcce

View file

@ -25,11 +25,13 @@ func resize_ui():
$HUD.position.y = size.y - hud_h $HUD.position.y = size.y - hud_h
func make_hud(): func make_hud():
var text = "Holding " + $Pivot/Container/Gear.gear_name() var text = ""
for node in $Backpack.get_children(): for node in $Backpack.get_children():
if not node is Gear: if not node is Gear:
continue 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 $HUD.text = text
func message(string): func message(string):