From 77515062aa385c5612f925660f974be426daf9ca Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Wed, 14 Jul 2021 01:27:18 +0100 Subject: [PATCH] actors: Correctly initialise enemies on new level or retry --- code/autoload/PlayerData.gd | 2 ++ code/objects/Portal.gd | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/autoload/PlayerData.gd b/code/autoload/PlayerData.gd index 5807aaa..8dc8f72 100644 --- a/code/autoload/PlayerData.gd +++ b/code/autoload/PlayerData.gd @@ -134,6 +134,7 @@ func new_level(): retry_chutes = chutes retry_health = health retry_score = score + get_tree().call_group("enemies", "queue_free") emit_signal("new_level") @@ -148,6 +149,7 @@ func retry_level(): score = retry_score time_limit = 300 time_remaining = 300 + get_tree().call_group("enemies", "queue_free") emit_signal("new_level") diff --git a/code/objects/Portal.gd b/code/objects/Portal.gd index 3674db6..2bab2b6 100644 --- a/code/objects/Portal.gd +++ b/code/objects/Portal.gd @@ -29,8 +29,6 @@ func _ready(): func fly_helicopter(skip_animation: bool = false): - get_tree().call_group("enemies", "queue_free") - if not skip_animation: anim_helicopter.play("spin_up") yield(anim_helicopter, "animation_finished")