From d192b1546ab39180cdc28d2621c117539e3d26d6 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 1 May 2024 09:41:02 +0200 Subject: update --- Scenes/Entities/Enemies/Components/Health.gd | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Scenes/Entities/Enemies/Components/Health.gd') 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") -- cgit v1.2.3