diff options
Diffstat (limited to 'Scenes/Entities/Enemies/Flowers.gd')
-rw-r--r-- | Scenes/Entities/Enemies/Flowers.gd | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Scenes/Entities/Enemies/Flowers.gd b/Scenes/Entities/Enemies/Flowers.gd index 5f8e974..9b6658e 100644 --- a/Scenes/Entities/Enemies/Flowers.gd +++ b/Scenes/Entities/Enemies/Flowers.gd @@ -28,9 +28,12 @@ func _ready(): var flower = FlowerScene.instantiate() flower.angle = deg_to_rad(120 * number) + flower.get_node("Health").hit.connect(func(): + flowers.remove_at(flowers.find(flower)) + ) + # if last flower is removed, remove self flower.get_node("Health").died.connect(func(): - flowers.remove_at(flowers.find(flower)) if flowers.is_empty(): queue_free() ) |