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.gd6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/hud/health_meter.gd b/ui/hud/health_meter.gd
index 5905e66..d625559 100644
--- a/ui/hud/health_meter.gd
+++ b/ui/hud/health_meter.gd
@@ -1,11 +1,13 @@
extends Control
@onready var full := $Full as TextureRect
-
+@onready var empty := $Empty as TextureRect
func _ready():
Globals.player.hp_changed.connect(_hp_changed)
-
+ var max_hp := Globals.player.max_health
+ full.size.x = max_hp * 5 + 1
+ empty.size.x = max_hp * 5 + 1
func _hp_changed(hp: int):
full.size.x = hp * 5 + 1