extends InputStrategy
class_name InputStrategy_InputIntro

var entry_time : int = 0
var mouse_anchor : Vector2 = Vector2(0, 0)

func enter() -> void:
	entry_time = Time.get_ticks_msec()
	mouse_anchor = get_viewport().get_mouse_position()

func exit() -> void:
	pass

func update() -> void:
	if (Time.get_ticks_msec() - entry_time > 500):
		transition_to(State.DRAGGING)
		return

	var distance_dragged = (get_viewport().get_mouse_position() - mouse_anchor).length()

	if (distance_dragged > 3.0):
		transition_to(State.DRAGGING)		

	if (not Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT)):
		transition_to(State.LETTER_CLICKED)

