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

View File

@@ -0,0 +1,23 @@
using Godot;
using Mr.BrickAdventures.Autoloads;
namespace Mr.BrickAdventures.scripts.Events;
[GlobalClass]
public partial class SpeedRunEventHandler : Node
{
private SpeedRunManager _speedRunManager;
public override void _Ready()
{
_speedRunManager = GetNode<SpeedRunManager>("/root/SpeedRunManager");
var eventBus = GetNode<EventBus>("/root/EventBus");
eventBus.LevelCompleted += OnLevelCompleted;
}
private void OnLevelCompleted(int levelIndex, Node currentScene, double completionTime)
{
_speedRunManager.Split();
}
}