Isometric implementation

This commit is contained in:
Marco 2025-06-10 16:33:43 +02:00
commit ed656f00bb
92 changed files with 2834 additions and 223 deletions

View file

@ -23,6 +23,8 @@ public partial class FreezeModule : ModuleBase<PlayerState, CharacterBody2D>
public bool Enabled { get; set; } = false;
private double _cooldownTimer = 0;
private IStateMachine<PlayerState, CharacterBody2D> _machine;
public override void EnterState(PlayerState state)
{
@ -33,9 +35,10 @@ public partial class FreezeModule : ModuleBase<PlayerState, CharacterBody2D>
{
Enabled = false;
}
public override void Init(IStateMachine<PlayerState, CharacterBody2D> machine)
{
_machine = machine;
}
public override void Process(double delta)
@ -77,7 +80,7 @@ public partial class FreezeModule : ModuleBase<PlayerState, CharacterBody2D>
where child.BulletOwner is not BulletOwner.Player
where !child.IsFrozen
where child.BulletInfo.Freezable
let distance = GlobalPosition.DistanceTo(child.GlobalPosition)
let distance = _machine.MainObject.GlobalPosition.DistanceTo(child.GlobalPosition)
where distance <= FreezeRadius
select child).ToList();
}