otherworldly_simulation/scene/test/run.gd

33 lines
582 B
GDScript3
Raw Normal View History

2024-10-25 15:41:39 +08:00
extends State
func enter_state(n):
pass
func update_state(delta):
pass
func update_state_phy(delta):
if get_player().is_move_finished():
change_to_state("idle")
print("切换为idle")
return
match get_player().get_dir():
0:
get_player().play_animation("up")
1:
get_player().play_animation("down")
2:
get_player().play_animation("left_right")
3:
get_player().play_animation("left_right")
pass
func exit_state():
pass
func process_message(type:String,n):
match type:
"move":
get_player().set_target_pos(n)
change_to_state("run")
pass