a game about throwing hammers made for the github game off
1
2
3
4
5
6
7
8
9
10
11
12
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