extends State func enter_state(n): pass func update_state(delta): pass func update_state_phy(delta): match get_player().get_dir(): 0: get_player().play_animation("up_idle") 1: get_player().play_animation("down_idle") 2: get_player().play_animation("left_right_idle") 3: get_player().play_animation("left_right_idle") pass func exit_state(): pass func process_message(type:String,n): match type: "move": get_player().set_target_pos(n) change_to_state("run") "attack": get_player().set_target_pos(n.global_position) change_to_state("run",n) pass pass