Add menu entries for both variants, use eight high-contrast colors with allowed duplicates, and turn wrong-guess pods off after a red blink until the next round. Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
1.6 KiB
GDScript
45 lines
1.6 KiB
GDScript
extends Control
|
|
|
|
const DEMO_SCENE := "res://scenes/demo.tscn"
|
|
const CONFIG_SCENE := "res://scenes/config.tscn"
|
|
const PONG_SCENE := "res://scenes/pong.tscn"
|
|
const COLOR_GAME_SCENE := "res://scenes/color_game.tscn"
|
|
const SPACE_SHOOTER_SCENE := "res://scenes/space_shooter.tscn"
|
|
const ColorGameScript = preload("res://scripts/color_game.gd")
|
|
|
|
@onready var demo_button: Button = $CenterBox/DemoButton
|
|
@onready var config_button: Button = $CenterBox/ConfigButton
|
|
@onready var pong_button: Button = $CenterBox/PongButton
|
|
@onready var digits_game_button: Button = $CenterBox/DigitsGameButton
|
|
@onready var colors_game_button: Button = $CenterBox/ColorsGameButton
|
|
@onready var space_shooter_button: Button = $CenterBox/SpaceShooterButton
|
|
@onready var exit_button: Button = $CenterBox/ExitButton
|
|
|
|
|
|
func _ready() -> void:
|
|
demo_button.pressed.connect(func(): _open_scene(DEMO_SCENE))
|
|
config_button.pressed.connect(func(): _open_scene(CONFIG_SCENE))
|
|
pong_button.pressed.connect(func(): _open_scene(PONG_SCENE))
|
|
digits_game_button.pressed.connect(_open_digits_game)
|
|
colors_game_button.pressed.connect(_open_colors_game)
|
|
space_shooter_button.pressed.connect(func(): _open_scene(SPACE_SHOOTER_SCENE))
|
|
exit_button.pressed.connect(_exit_game)
|
|
|
|
|
|
func _open_digits_game() -> void:
|
|
ColorGameScript.start_mode = ColorGameScript.GameMode.DIGITS
|
|
_open_scene(COLOR_GAME_SCENE)
|
|
|
|
|
|
func _open_colors_game() -> void:
|
|
ColorGameScript.start_mode = ColorGameScript.GameMode.COLORS
|
|
_open_scene(COLOR_GAME_SCENE)
|
|
|
|
|
|
func _open_scene(path: String) -> void:
|
|
get_tree().change_scene_to_file(path)
|
|
|
|
|
|
func _exit_game() -> void:
|
|
get_tree().quit()
|