34 lines
696 B
GDScript
34 lines
696 B
GDScript
extends Control
|
|
|
|
|
|
export var first_level: PackedScene
|
|
|
|
|
|
onready var difficulty_buttons := [
|
|
$"%BeginnerButton",
|
|
$"%AdvancedButton",
|
|
$"%AdvancedButton",
|
|
$"%ProfessionalButton",
|
|
]
|
|
|
|
|
|
func _ready() -> void:
|
|
yield(get_tree(), "idle_frame")
|
|
difficulty_buttons[Game.difficulty].grab_focus()
|
|
Fade.fade_in()
|
|
|
|
|
|
func _input(event: InputEvent) -> void:
|
|
if Input.is_action_just_pressed("ui_accept"):
|
|
Game.lives = Game.marathon_lives
|
|
Game.marathon_score = 0
|
|
Game.marathon_shards = 0
|
|
Game.change_map(first_level)
|
|
|
|
|
|
func _set_difficulty(difficulty: int) -> void:
|
|
Game.difficulty = difficulty
|
|
|
|
|
|
func _on_DifficultySelect_focus_entered() -> void:
|
|
difficulty_buttons[Game.difficulty].grab_focus()
|