extends State var init_position:Vector2=Vector2.ZERO var target_y:float=200 var need_target:bool=false func enter_state(n): get_player().up() need_target=get_player().need_target() init_position=get_player().position if n is Vector2: init_position=n pass func update_state(delta): get_player().position=get_player().get_parent().get_local_mouse_position() var change_y=(init_position-get_player().get_parent().get_local_mouse_position()).y if Input.is_action_just_released("mouse_left"): if change_y>target_y and not need_target: change_to_state("queue",null) return else: change_to_state("selected_back") return if Input.is_action_just_pressed("mouse_right"): change_to_state("selected_back") return if need_target and change_y>target_y: change_to_state("select_target",init_position) return pass func update_state_phy(delta): pass func exit_state(): get_player().down() pass func time_out(): pass func process_message(type:String,n): pass