refactor: movement system - MovementPreset, decouple abilities, fix timing
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using Godot;
|
||||
using Mr.BrickAdventures.scripts.Resources;
|
||||
|
||||
namespace Mr.BrickAdventures.scripts.components;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class SpaceshipEnterComponent : Area2D
|
||||
{
|
||||
[Export] public MovementPreset Preset { get; set; }
|
||||
[Signal] public delegate void SpaceshipEnteredEventHandler();
|
||||
|
||||
public override void _Ready()
|
||||
@@ -15,7 +17,7 @@ public partial class SpaceshipEnterComponent : Area2D
|
||||
private void OnBodyEntered(Node2D body)
|
||||
{
|
||||
if (body is not PlayerController player) return;
|
||||
player.SetSpaceshipMovement();
|
||||
player.ApplyPreset(Preset);
|
||||
EmitSignalSpaceshipEntered();
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user