summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Enemies/Flowers.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-07-19 14:24:09 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-07-19 14:24:09 +0200
commit294f87adb4441ec25316601505ca1a7e97fa24c7 (patch)
treee48ed54e97f19ae5dd189ee42ddb73c4e995175f /Scenes/Entities/Enemies/Flowers.gd
parent06647b11ee163bc40daf454d87e1fcae563c3ced (diff)
update
Diffstat (limited to 'Scenes/Entities/Enemies/Flowers.gd')
-rw-r--r--Scenes/Entities/Enemies/Flowers.gd5
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()
)