Files
imnotsick/Scenes/UI/its_game_over_control.gd
T
2026-02-27 16:29:12 +01:00

34 lines
816 B
GDScript

extends Control
@onready var background = $Background
@onready var back_to_menu = $UI/HBoxContainer/BackToMainMenu
@onready var reload_checkpoint = $UI/HBoxContainer/ReloadCheckpoint
@onready var message = $UI/Message
@onready var animation_player = $AnimationPlayer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#Hiding everything
hide()
for node in [background, back_to_menu, reload_checkpoint, message]:
node.hide()
#Reveals the game over screen
func reveal():
#Reveals the background image first
show()
background.show()
background.reveal_spray()
await background.reveal_done
#Reveals the text and buttons afterwards
for node in [message, back_to_menu, reload_checkpoint]:
node.modulate.a = 0.0
node.show()
animation_player.play("fade_in")