Files
imnotsick/Scenes/UI/its_game_over_control.gd
T
2026-03-05 18:13:49 +01:00

35 lines
866 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:
#Resets to initial state
reset()
#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")
#Resets to initial state
func reset():
for node in [background, back_to_menu, reload_checkpoint, message]:
node.hide()
hide()