aboutsummaryrefslogtreecommitdiffstats
path: root/HealthBar.gd
diff options
context:
space:
mode:
Diffstat (limited to 'HealthBar.gd')
-rw-r--r--HealthBar.gd6
1 files changed, 4 insertions, 2 deletions
diff --git a/HealthBar.gd b/HealthBar.gd
index ae4ce42..91a5b8e 100644
--- a/HealthBar.gd
+++ b/HealthBar.gd
@@ -4,11 +4,11 @@ extends ProgressBar
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
-
+signal player_dead
# Called when the node enters the scene tree for the first time.
func _ready():
- pass # Replace with function body.
+ connect("player_dead", get_node("/root/Main/HUD/Wordart"), "_on_player_dead")
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -16,3 +16,5 @@ func _ready():
# pass
func _on_player_hit(delta):
value -= delta * 20
+ if value == 0:
+ emit_signal("player_dead")