Updated weapon logic. Fixed player CheckMove logic.
This commit is contained in:
@@ -19,6 +19,10 @@ public abstract class Mine : MoveableSprite
|
||||
protected float RotationSpeed { get; set; } = 1.5f;
|
||||
protected double DistanceToPlayer { get; set; } = double.MaxValue;
|
||||
|
||||
private MineState State { get; set; } = MineState.Drifting;
|
||||
private Vector2? CurrentTarget { get; set; }
|
||||
|
||||
|
||||
public Mine(int x, int y) : base(x, y)
|
||||
{
|
||||
Origin = new(30, 33);
|
||||
@@ -77,6 +81,19 @@ public abstract class Mine : MoveableSprite
|
||||
}
|
||||
|
||||
Rotation = MathHelper.WrapAngle(Rotation + RotationSpeed * context.DeltaTime);
|
||||
|
||||
switch (State)
|
||||
{
|
||||
case MineState:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Charge(Vector2 target)
|
||||
{
|
||||
State = MineState.Charging;
|
||||
CurrentTarget = target;
|
||||
}
|
||||
|
||||
private void UpdateDistanceToPlayer(SpriteUpdateContext context)
|
||||
|
||||
7
AlientAttack.MonoGame/Things/Enemies/Mines/MineState.cs
Normal file
7
AlientAttack.MonoGame/Things/Enemies/Mines/MineState.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace AlienAttack.MonoGame.Things.Enemies.Mines;
|
||||
|
||||
public enum MineState
|
||||
{
|
||||
Drifting,
|
||||
Charging
|
||||
}
|
||||
Reference in New Issue
Block a user