44 lines
902 B
C#
44 lines
902 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, _lb0;
|
|
|
|
[Export]
|
|
private Timer _tmr;
|
|
|
|
// Called when the node enters the scene tree for the first time.
|
|
public override void _Ready()
|
|
{
|
|
_lbls = new();
|
|
_lbls.Add(_lb0);
|
|
_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://endings/the_end.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)
|
|
{
|
|
}
|
|
}
|