extends Area2D

@export var coin_id: String

func _ready():
	if coin_id == "":
		coin_id = name
		
	if GameManager.collected_coins.has(coin_id):
		queue_free()

func _on_body_entered(body: Node2D) -> void:
	GameManager.add_score()
	GameManager.collected_coins[coin_id] = true
	queue_free()
