summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Enemies/Components/Health.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-05-01 09:41:02 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-05-01 09:41:02 +0200
commitd192b1546ab39180cdc28d2621c117539e3d26d6 (patch)
treebfe040b5fa56aab1cf1161aab4883ba6ca3510df /Scenes/Entities/Enemies/Components/Health.gd
parent81cc6f1d22677dd4a60aa9377c91b291bf10e523 (diff)
update
Diffstat (limited to 'Scenes/Entities/Enemies/Components/Health.gd')
-rw-r--r--Scenes/Entities/Enemies/Components/Health.gd4
1 files changed, 4 insertions, 0 deletions
diff --git a/Scenes/Entities/Enemies/Components/Health.gd b/Scenes/Entities/Enemies/Components/Health.gd
index f5e231e..d6b7361 100644
--- a/Scenes/Entities/Enemies/Components/Health.gd
+++ b/Scenes/Entities/Enemies/Components/Health.gd
@@ -3,6 +3,8 @@ extends Node
class_name Component_Health
+signal died
+
@export_node_path("CharacterBody2D") var entityPath: NodePath
@onready var entity: CharacterBody2D = get_node(entityPath)
@@ -20,6 +22,8 @@ func take_damage():
func death():
+ emit_signal("died")
+
entity.set_physics_process(false)
sprite.play("death")