19 lines
600 B
GDScript
19 lines
600 B
GDScript
extends Control
|
|
|
|
var blur_amount = 3
|
|
|
|
func _ready():
|
|
$ColorRect.visible = false
|
|
print("Starting state: ", $GameState.current_state_name())
|
|
|
|
func _on_GameState_state_changed(previous, current):
|
|
print("GameState: ", $GameState.State.keys()[previous], " -> ", $GameState.State.keys()[current])
|
|
match current:
|
|
GameState.State.WINNING:
|
|
print("Solved!")
|
|
# TODO: wait for the animation to finish before game over
|
|
#$GameState.transition_to(GameState.State.GAME_OVER)
|
|
GameState.State.GAME_OVER:
|
|
$ColorRect.visible = true
|
|
$ColorRect.material.set_shader_param("blur_amount", blur_amount)
|