From 276b7664bd4a475a3ca93a682c16b49c504c58f7 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 6 May 2024 16:30:46 +0200 Subject: update --- Scenes/Utilities.gd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Scenes/Utilities.gd') diff --git a/Scenes/Utilities.gd b/Scenes/Utilities.gd index f43a359..87c3539 100644 --- a/Scenes/Utilities.gd +++ b/Scenes/Utilities.gd @@ -100,6 +100,12 @@ func dialog(timeline: Variant): self.has_dialog = false +func get_enemy_children(parent: Node): + return parent.get_children().filter( + func(child: Node2D): return child.is_in_group("enemies") + ) + + func get_collision_shape_bounds(collision_shape: CollisionShape2D): var shape: Shape2D = collision_shape.shape var bounds @@ -175,3 +181,11 @@ class Collision: const SOLID = 4 const ENEMY = 5 const EXPLOSION = 6 + + +class Condition: + signal fulfilled + var function: Callable + + func check(): + return function.call() -- cgit v1.2.3