Last stretch
This commit is contained in:
parent
466a154972
commit
68271c94ed
13 changed files with 338 additions and 99 deletions
28
scripts/WinScreen.cs
Normal file
28
scripts/WinScreen.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue