summaryrefslogtreecommitdiff
path: root/Scenes/Utilities.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-05-06 16:30:46 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-05-06 16:30:46 +0200
commit276b7664bd4a475a3ca93a682c16b49c504c58f7 (patch)
tree6b8f8cf0e1a82496c1f539e55e26bc078300b23a /Scenes/Utilities.gd
parent8c0e8b5bf73caaf2fd6f04fb97b9c13f2970c431 (diff)
update
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()