31 lines
667 B
GDScript
31 lines
667 B
GDScript
extends State
|
|
var init_position:Vector2
|
|
var target_y:float=200
|
|
func enter_state(n):
|
|
init_position=n
|
|
get_player().open_arrow()
|
|
func update_state(delta):
|
|
if Input.is_action_just_released("mouse_left"):
|
|
change_to_state("selected_back")
|
|
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()
|
|
pass
|
|
|
|
func time_out():
|
|
pass
|
|
func process_message(type:String,n):
|
|
|
|
|
|
pass
|