extends Node2D

onready var global: Node = get_node("/root/Global")

onready var crystals = $Crystals

func _ready():
	if global.game_vars.has("crystal_grabbed"):
		grabbed_crystal()

func _on_Crystals_used():
	if global.inventory.add_item(global.inventory.Items.crystal):
		global.game_vars["crystal_grabbed"] = true
		grabbed_crystal()

func grabbed_crystal() -> void:
	crystals.queue_free()

