diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-05-03 09:32:22 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-05-03 09:32:22 +0200 |
commit | 516d22c1737a9c94026b5ff0c9856bc5549aa416 (patch) | |
tree | cd9ef3089d1c8bdfc440b5673f7ad0d0dce787a9 /Scenes/Entities/Enemies/Components/Collision.gd | |
parent | d192b1546ab39180cdc28d2621c117539e3d26d6 (diff) |
update
Diffstat (limited to 'Scenes/Entities/Enemies/Components/Collision.gd')
-rw-r--r-- | Scenes/Entities/Enemies/Components/Collision.gd | 11 |
1 files changed, 7 insertions, 4 deletions
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) + ) |