extends StateAnimatedActor

export (NodePath) var idle_node

onready var idle_state: State = get_node(idle_node)

func process_physics(delta: float) -> State:
	#parent.velocity.y += gravity * delta
	move_component.velocity.y += gravity * delta

	move_component.velocity.x = move_component.desired_movement_vector.x * move_speed
	move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))

	if move_component.get_movement_direction() != 0.0:
		parent.transform.x.x = move_component.get_movement_direction()
	
	if parent.is_on_floor():
		return idle_state
	return null
