refactor: movement system - MovementPreset, decouple abilities, fix timing
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user