27 lines
804 B
GDScript
27 lines
804 B
GDScript
extends CanvasLayer
|
|
|
|
onready var retry_button = $Panel/Retry
|
|
onready var exit_button = $Panel/Exit
|
|
onready var score: Label = $"%Score"
|
|
onready var shards: Label = $"%Shards"
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
score.text = score.text % Game.marathon_score
|
|
shards.text = shards.text % (Game.marathon_shards + Game.shards)
|
|
Fade.fade_in(0.4)
|
|
get_tree().paused = true
|
|
retry_button.grab_focus()
|
|
Audio.ac_music.stream_paused = false
|
|
Audio.play_music(load("res://audio/music/74(game_over).ogg"))
|
|
|
|
func _on_Exit_button_down():
|
|
Fade.fade_out(0.4)
|
|
yield(Fade, "fade_finished")
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_Retry_button_down():
|
|
Fade.fade_out(0.4)
|
|
yield(Fade, "fade_finished")
|
|
SceneManager.current_scene = load("res://menus/marathon_start.tscn").instance()
|