From 06647b11ee163bc40daf454d87e1fcae563c3ced Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 23 May 2024 14:11:43 +0200 Subject: update --- Scenes/Utilities.gd | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Scenes/Utilities.gd') diff --git a/Scenes/Utilities.gd b/Scenes/Utilities.gd index 87c3539..092e853 100644 --- a/Scenes/Utilities.gd +++ b/Scenes/Utilities.gd @@ -106,6 +106,16 @@ func get_enemy_children(parent: Node): ) +func get_all_children(parent: Node): + var children = [] + + for child in parent.get_children(): + children.append(child) + children += get_all_children(child) + + return children + + func get_collision_shape_bounds(collision_shape: CollisionShape2D): var shape: Shape2D = collision_shape.shape var bounds @@ -188,4 +198,8 @@ class Condition: var function: Callable func check(): - return function.call() + var is_fulfilled = function.call() + if is_fulfilled: + fulfilled.emit() + + return is_fulfilled -- cgit v1.2.3