Refactor health management and collectable cleanup logic for improved functionality

This commit is contained in:
2025-05-29 01:19:18 +02:00
parent a098155b0f
commit 9b6a4f38bd
4 changed files with 33 additions and 54 deletions

View File

@@ -30,8 +30,9 @@ func _on_area2d_body_entered(body: Node2D) -> void:
collision_shape.call_deferred("set_disabled", true)
if sfx:
sfx.play()
if not has_fade_away:
if sfx:
if not has_fade_away and sfx:
await sfx.finished
root.queue_free()
root.queue_free()
elif not has_fade_away:
root.queue_free()