diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-05-06 16:30:46 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-05-06 16:30:46 +0200 |
commit | 276b7664bd4a475a3ca93a682c16b49c504c58f7 (patch) | |
tree | 6b8f8cf0e1a82496c1f539e55e26bc078300b23a /Scenes/Utilities.gd | |
parent | 8c0e8b5bf73caaf2fd6f04fb97b9c13f2970c431 (diff) |
update
Diffstat (limited to 'Scenes/Utilities.gd')
-rw-r--r-- | Scenes/Utilities.gd | 14 |
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() |