From 8b0ce964d2aa5dba186b85abf64b70ffc8216c06 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 15 Aug 2022 09:35:35 +0300 Subject: Add UI --- GlobalData.gd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'GlobalData.gd') diff --git a/GlobalData.gd b/GlobalData.gd index 1ee67a1..8cf9d94 100644 --- a/GlobalData.gd +++ b/GlobalData.gd @@ -4,11 +4,16 @@ export(int) var player_hp = 3 export(float) var GRAVITY: float = 1200 export(float) var MAX_FALL_SPEED: float = 1200 +signal player_hp_changed + +func add_player_hp(delta: int): + player_hp += delta + emit_signal("player_hp_changed", player_hp) + # Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body. - # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta): # pass -- cgit v1.3