extends PlayerState


func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void:
	print("entering walking")
	player.move_and_slide()


func _state_physics_update(_delta: float) -> void:
#region player physics
	var direction: Vector2 = player.get_movement_vector()
	direction = direction.normalized()
	player.velocity = direction * player.max_speed * player.speed_mult
	
	player.move_and_slide()
#endregion
	
	if watch_state([WALKING]): return
	
#region player animation
	if direction.y > 0: player.sprite.play("walk_down")
	elif direction.y < 0: player.sprite.play("walk_up")
	elif direction.x > 0: player.sprite.play("walk_right")
	elif direction.x < 0: player.sprite.play("walk_left")
#endregion
