extends Node
class_name GameGui

@export var mecha : Mecha

func _process(_delta):
    %FPSCount.text = "%d fps" % Engine.get_frames_per_second()
    if mecha:
        %HPProgressBar.value = lerp(
            %HPProgressBar.value,
            (mecha.hp / Mecha.MAX_HP) * 100.,
            0.5,
        )
    else:
        printerr("Missing mecha in GameGui")

func show_lose_gui():
    %LooseAnimationPlayer.play("Appear")

func _on_retry_button_pressed():
    get_tree().paused = false
    get_tree().reload_current_scene()

