check internal state in _input()
This commit is contained in:
parent
7b25ae028b
commit
23ca5db700
|
@ -19,6 +19,8 @@ func current_state_name() -> String:
|
||||||
return State.keys()[current_state]
|
return State.keys()[current_state]
|
||||||
|
|
||||||
func transition_to(state):
|
func transition_to(state):
|
||||||
|
if current_state == state:
|
||||||
|
return
|
||||||
assert(state in transitions[current_state])
|
assert(state in transitions[current_state])
|
||||||
var previous_state = current_state
|
var previous_state = current_state
|
||||||
current_state = state
|
current_state = state
|
||||||
|
|
|
@ -87,6 +87,13 @@ func _ready() -> void:
|
||||||
shuffle(difficulty)
|
shuffle(difficulty)
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _input(event):
|
||||||
|
if $AnimationPlayer.is_playing():
|
||||||
|
# Disable input during animation
|
||||||
|
return
|
||||||
|
|
||||||
var game_state = get_node_or_null("/root/Main/GameState") as GameState
|
var game_state = get_node_or_null("/root/Main/GameState") as GameState
|
||||||
if game_state != null:
|
if game_state != null:
|
||||||
match game_state.current_state:
|
match game_state.current_state:
|
||||||
|
@ -97,11 +104,6 @@ func _process(delta):
|
||||||
GameState.State.GAME_OVER:
|
GameState.State.GAME_OVER:
|
||||||
return
|
return
|
||||||
|
|
||||||
func _input(event):
|
|
||||||
if $AnimationPlayer.is_playing():
|
|
||||||
# Disable input during animation
|
|
||||||
return
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Handle keyboard input
|
# Handle keyboard input
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue