2024-09-25 11:52:36 +08:00
|
|
|
extends State
|
|
|
|
var init_position:Vector2
|
|
|
|
var target_y:float=200
|
|
|
|
func enter_state(n):
|
2024-09-25 18:04:02 +08:00
|
|
|
var player:Card=get_player() as Card
|
|
|
|
player.move_to(player.position,player.get_queue_position())
|
2024-09-25 11:52:36 +08:00
|
|
|
init_position=n
|
|
|
|
get_player().open_arrow()
|
2024-09-25 23:56:53 +08:00
|
|
|
get_player().up()
|
2024-09-25 11:52:36 +08:00
|
|
|
func update_state(delta):
|
|
|
|
if Input.is_action_just_released("mouse_left"):
|
2024-09-25 18:04:02 +08:00
|
|
|
var target=get_player().get_select_result()
|
|
|
|
if target!=null:
|
|
|
|
change_to_state("queue",target)
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
change_to_state("selected_back")
|
|
|
|
return
|
2024-09-25 11:52:36 +08:00
|
|
|
return
|
|
|
|
if Input.is_action_just_pressed("mouse_right"):
|
|
|
|
change_to_state("selected_back")
|
|
|
|
return
|
|
|
|
pass
|
|
|
|
var change_y=(init_position-get_player().get_parent().get_local_mouse_position()).y
|
|
|
|
if change_y<target_y:
|
|
|
|
change_to_state("selected",init_position)
|
|
|
|
return
|
|
|
|
func update_state_phy(delta):
|
|
|
|
pass
|
|
|
|
func exit_state():
|
|
|
|
get_player().close_arrow()
|
2024-09-25 23:56:53 +08:00
|
|
|
get_player().down()
|
2024-09-25 11:52:36 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
func time_out():
|
|
|
|
pass
|
|
|
|
func process_message(type:String,n):
|
|
|
|
|
|
|
|
|
|
|
|
pass
|