extends Area2D

@onready var animation_player: AnimationPlayer = $AnimationPlayer

var game_manager: Node

func _ready() -> void:
	if not game_manager:
		game_manager = get_tree().get_first_node_in_group("game_manager")

func _on_body_entered(body: Node2D) -> void:
	if body.is_in_group("player"):
		if game_manager:
			game_manager.add_health()
		animation_player.play("pickup")
