implement marathon start screen
This commit is contained in:
parent
048d63a353
commit
db0a61e162
7 changed files with 267 additions and 53 deletions
|
@ -4,11 +4,31 @@ 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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue