Add EventBus, SpeedRunManager, and GhostManager; implement ghost recording and playback features

This commit is contained in:
2025-09-13 03:30:15 +02:00
parent 46553a351a
commit dfc9201f62
24 changed files with 526 additions and 4 deletions

26
scripts/UI/SpeedRunHud.cs Normal file
View File

@@ -0,0 +1,26 @@
using Godot;
using Mr.BrickAdventures.Autoloads;
namespace Mr.BrickAdventures.scripts.UI;
[GlobalClass]
public partial class SpeedRunHud : Control
{
[Export] private Label _timerLabel;
private SpeedRunManager _speedRunManager;
public override void _Ready()
{
_speedRunManager = GetNode<SpeedRunManager>("/root/SpeedRunManager");
_speedRunManager.TimeUpdated += OnTimerUpdated;
Visible = _speedRunManager.IsVisible;
}
private void OnTimerUpdated(double totalTime, double levelTime)
{
_timerLabel.Text = SpeedRunManager.FormatTime(totalTime);
}
}

View File

@@ -0,0 +1 @@
uid://0jfdx0hufs55