Mutually_Assured_Destruction/endings/mad.cs
2023-06-11 15:52:12 -04:00

43 lines
882 B
C#

using Godot;
using System;
using System.Collections.Generic;
public partial class mad : Control
{
private List<Label> _lbls;
[Export]
private Label _lb1, _lb2, _lb3, _lb4;
[Export]
private Timer _tmr;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
_lbls = new();
_lbls.Add(_lb1);
_lbls.Add(_lb2);
_lbls.Add(_lb3);
_lbls.Add(_lb4);
_tmr.Timeout += () => Tick();
}
private void Tick() {
if (_lbls.Count > 0) {
_lbls[0].Set("visible", true);
_lbls.Remove(_lbls[0]);
} else {
var scene = GD.Load<PackedScene>("res://menu/start_game_menu.tscn");
var instance = scene.Instantiate();
GetNode<Node>("/root/").AddChild(instance);
this.QueueFree();
}
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}