summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Enemies/Components/Collision.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/Collision.gd
parent81cc6f1d22677dd4a60aa9377c91b291bf10e523 (diff)
update
Diffstat (limited to 'Scenes/Entities/Enemies/Components/Collision.gd')
-rw-r--r--Scenes/Entities/Enemies/Components/Collision.gd4
1 files changed, 3 insertions, 1 deletions
diff --git a/Scenes/Entities/Enemies/Components/Collision.gd b/Scenes/Entities/Enemies/Components/Collision.gd
index 2dfba2a..6e25402 100644
--- a/Scenes/Entities/Enemies/Components/Collision.gd
+++ b/Scenes/Entities/Enemies/Components/Collision.gd
@@ -14,9 +14,11 @@ signal collided
@export_node_path("Component_Health") var component_health_path: NodePath
var component_health: Component_Health
+var collision_area: Area2D
+
func init():
- var collision_area = Utilities.Collision.Area.new(entity, collision_shape)
+ collision_area = Utilities.Collision.Area.new(entity, collision_shape)
collision_area.set_collision_mask_value(Utilities.Collision.Layer.PLAYER, true)
collision_area.connect("collided", func(area): emit_signal("collided", area))
entity.add_child(collision_area)