extends Area2D

signal crystal_picked_up



func _ready():
	add_to_group("crystals")

func _on_body_entered(body: Node2D) -> void:
	if body.name == "player":
		emit_signal("crystal_picked_up")
		queue_free()
		
	else:
		print("Whoops, something went wrong")

func _on_mouse_collision_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
	if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT):
		var destination: Vector2 = get_global_mouse_position()
		global_position = global_position.move_toward(destination, 1.0)
#git is shit
