summaryrefslogtreecommitdiff
path: root/Scenes/Utilities.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Scenes/Utilities.gd')
-rw-r--r--Scenes/Utilities.gd14
1 files changed, 14 insertions, 0 deletions
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()