taqin/game/src/Main.gd

19 lines
600 B
GDScript3
Raw Normal View History

2019-11-26 13:57:50 +01:00
extends Control
2020-01-04 19:22:11 +01:00
var blur_amount = 3
func _ready():
$ColorRect.visible = false
2020-01-07 13:54:06 +01:00
print("Starting state: ", $GameState.current_state_name())
2020-01-04 19:22:11 +01:00
2020-01-07 13:54:06 +01:00
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
2020-01-12 18:51:07 +01:00
#$GameState.transition_to(GameState.State.GAME_OVER)
2020-01-07 13:54:06 +01:00
GameState.State.GAME_OVER:
$ColorRect.visible = true
$ColorRect.material.set_shader_param("blur_amount", blur_amount)