extends RigidBody2D

var held = false

func _ready() -> void:
	$AnimatedSprite.frame = randi() % $AnimatedSprite.frames.get_frame_count("default")




func _physics_process(delta):
	$Shine.rotation_degrees = -rotation_degrees
	if held:
		global_transform.origin = get_global_mouse_position()




func drop(impulse=Vector2.ZERO):
	if held:
		mode = RigidBody2D.MODE_RIGID
		apply_central_impulse(impulse)
		held = false
