a game about throwing hammers made for the github game off
Diffstat (limited to 'ui/hud/health_meter.gd')
-rw-r--r--ui/hud/health_meter.gd11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/hud/health_meter.gd b/ui/hud/health_meter.gd
new file mode 100644
index 0000000..5905e66
--- /dev/null
+++ b/ui/hud/health_meter.gd
@@ -0,0 +1,11 @@
+extends Control
+
+@onready var full := $Full as TextureRect
+
+
+func _ready():
+ Globals.player.hp_changed.connect(_hp_changed)
+
+
+func _hp_changed(hp: int):
+ full.size.x = hp * 5 + 1