MAD World
This commit is contained in:
34
endings/the_end.cs
Normal file
34
endings/the_end.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class the_end : Control
|
||||
{
|
||||
[Export]
|
||||
private Label _lbl;
|
||||
|
||||
[Export]
|
||||
private Timer _tim;
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
_tim.Timeout += Tick;
|
||||
}
|
||||
|
||||
private int _tock = 0;
|
||||
private void Tick() {
|
||||
if (_tock == 0)
|
||||
_lbl.Set("visible", true);
|
||||
if (_tock == 4) {
|
||||
var scene = GD.Load<PackedScene>("res://menu/start_game_menu.tscn");
|
||||
var instance = scene.Instantiate();
|
||||
GetNode<Node>("/root/").AddChild(instance);
|
||||
this.QueueFree();
|
||||
}
|
||||
_tock++;
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user