If I understand your question correctly, you have a bird (kinematic body 2d) collecting apples (area 2ds) and you want all the apples to disapear when the bird dies.
To keep things simple, add an autoload script to your project and call it PlayerInfo (or whatever you like). Declare a signal inside that script:
signal player_died
Now, inside the bird script, when the bird is just about to die (before you call queue_free()
) emit the signal:
PlayerInfo.emit("player_died")
Finally catch that signal inside the apple script.
First connect the signal inside the _ready()
function:
PlayerInfo.connect("player_died", self, "_on_player_died")
Then declare the _on_player_died()
function:
func _on_player_died() -> void:
queue_free() // if you want to kill the apple or
hide() // if if you just want to hide it