From 516d22c1737a9c94026b5ff0c9856bc5549aa416 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 3 May 2024 09:32:22 +0200 Subject: update --- Scenes/Entities/Enemies/Components/Collision.gd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Scenes/Entities/Enemies/Components/Collision.gd') diff --git a/Scenes/Entities/Enemies/Components/Collision.gd b/Scenes/Entities/Enemies/Components/Collision.gd index 6e25402..5a82c31 100644 --- a/Scenes/Entities/Enemies/Components/Collision.gd +++ b/Scenes/Entities/Enemies/Components/Collision.gd @@ -1,7 +1,6 @@ +class_name ComponentCollision extends Node -class_name Component_Collision - signal collided @@ -11,8 +10,8 @@ signal collided @export_node_path("CollisionShape2D") var collision_shape_path: NodePath @onready var collision_shape: CollisionShape2D = get_node(collision_shape_path) -@export_node_path("Component_Health") var component_health_path: NodePath -var component_health: Component_Health +@export_node_path("ComponentHealth") var component_health_path: NodePath +var component_health: ComponentHealth var collision_area: Area2D @@ -29,3 +28,7 @@ func init(): if area.is_in_group("explosions"): component_health.take_damage() ) + component_health.died.connect(func(): + collision_area.set_collision_layer_value(Utilities.Collision.Layer.ENEMY, false) + collision_area.set_collision_mask_value(Utilities.Collision.Layer.PLAYER, false) + ) -- cgit v1.2.3