Last stretch

This commit is contained in:
Иван Кузьменко 2023-08-19 15:23:08 +03:00
parent 466a154972
commit 68271c94ed
13 changed files with 338 additions and 99 deletions

28
scripts/WinScreen.cs Normal file
View file

@ -0,0 +1,28 @@
using Godot;
using System;
public partial class WinScreen : TextureRect
{
[Export] public GameManager Manager;
public override void _Ready()
{
Visible = false;
}
public void Open()
{
Visible = true;
((Label)FindChild("Label2")).Text =
$"It took you\n{Manager.GetAttempts()} attempts\nand {Manager.GetFormattedTimeElapsed()}\nto finish the game.";
}
public override void _Input(InputEvent @event)
{
if (Visible && @event.IsActionPressed("ui_confirm"))
{
GetTree().ChangeSceneToFile("res://scenes/menu.tscn");
}
}
}