extends PlayerState

@export
var idle_state: PlayerState

const TILE_SIZE: Vector2 = Vector2(GlobalConstants.TILE_SIZE, GlobalConstants.TILE_SIZE)
const TILE_TRANSITION_SPEED = 0.3
var sprite_node_position_tween: Tween



func enter() -> void:
    super()
    

func process_input(event: InputEvent) -> PlayerState:
    var direction: Vector2 = _get_movement_vector()
    if direction == Vector2.ZERO:
        return idle_state
    return null

func process_frame(delta: float) -> PlayerState:
    if Input.is_action_pressed("east"):
        self.animation_name = "walk_east"
    elif Input.is_action_pressed("west"):
        self.animation_name = "walk_west"
    elif Input.is_action_pressed("north"):
        self.animation_name = "walk_north"
    elif Input.is_action_pressed("south"):
        self.animation_name = "walk_south"
    parent.animated_sprite.play(self.animation_name)
    return null