bodypartfighter/UI/PlayerHealth.gd

22 lines
496 B
GDScript

extends ProgressBar
export(int) var player_id
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
InGameState.connect("player_health_updated", self, "_on_player_health_updated")
max_value = InGameState.max_health
func _on_player_health_updated(updated_id, updated_health):
if player_id == updated_id:
value = updated_health
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass