refactor: movement system - MovementPreset, decouple abilities, fix timing

This commit is contained in:
2026-03-19 02:45:26 +01:00
parent adaeb35fdd
commit 814d9736d0
11 changed files with 58 additions and 95 deletions

View File

@@ -1,6 +1,7 @@
using System.Linq;
using Godot;
using Mr.BrickAdventures.scripts.components;
using Mr.BrickAdventures.scripts.Resources;
namespace Mr.BrickAdventures.scripts;
@@ -8,17 +9,17 @@ namespace Mr.BrickAdventures.scripts;
public partial class PacXonLevel : Node
{
[Export] public PlayerController Player { get; set; }
[Export] public MovementPreset GridPreset { get; set; }
[Export] public PacXonGridManager GridManager { get; set; }
[Export] public Node GhostContainer { get; set; }
[Export] public Label PercentageLabel { get; set; }
private const float WinPercentage = 0.90f;
public override void _Ready()
{
var ghosts = GhostContainer.GetChildren().OfType<Node2D>().ToList();
Player.ClearMovementAbilities();
Player.SetGridMovement();
Player.ApplyPreset(GridPreset);
foreach (var ghost in ghosts)
{