Explosion_der_Spiele/scripts/levels/death_screen.gd
copilot 938cc4bc82 Initial scaffold: Godot 4.3 scenes, systems, and placeholders.
Wire all twelve levels with billboard prefabs, autoload systems (inventory, achievements, mock shop, DE/EN/BY), and satire audio locks so the Title→End flow is playable with placeholder assets.
2026-09-14 18:36:02 +02:00

36 lines
1 KiB
GDScript

extends Control
## Blinky death screen with cause text + skull every 10s.
## TODO: Final flashy death art.
@onready var title: Label = $Title
@onready var cause: Label = $Cause
@onready var cont: Button = $ContinueButton
@onready var skull: ColorRect = $Skull
var _blink: float = 0.0
var _skull_timer: float = 0.0
func _ready() -> void:
GameState.current_scene_id = "death_screen"
_refresh()
Locale.locale_changed.connect(_refresh)
skull.visible = false
func _refresh() -> void:
title.text = Locale.tr_key("death_title")
cause.text = Locale.tr_key(GameState.last_death_cause_key)
cont.text = Locale.tr_key("death_continue")
func _process(delta: float) -> void:
_blink += delta
modulate = Color(1, 0.4 + 0.6 * abs(sin(_blink * 6.0)), 0.4 + 0.6 * abs(sin(_blink * 4.0)))
_skull_timer += delta
if _skull_timer >= 10.0:
_skull_timer = 0.0
skull.visible = true
await get_tree().create_timer(1.0).timeout
skull.visible = false
func _on_continue_pressed() -> void:
GameState.heal_full()
GameState.goto_scene("title_screen")