diff options
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) + ) |