This commit is contained in:
AnloGames 2023-08-18 20:22:28 +03:00
parent ec8e0a8cd5
commit e70cae920c

View file

@ -344,6 +344,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
Height = 5; Height = 5;
Width = 5; Width = 5;
} }
int time = 0;
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft" }, "playerMoveLeft"); protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft" }, "playerMoveLeft");
Vector2 direction; Vector2 direction;
public Vector2 maindirection; public Vector2 maindirection;
@ -414,10 +415,14 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
} }
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
{ {
if (maindirection != velocity) if (time >= 10)
{ {
AppManager.Instance.GameManager.Remove(this); AppManager.Instance.GameManager.Remove(this);
} }
if (gameTime.TotalGameTime.Milliseconds > 800)
{
time += 1;
}
base.Update(gameTime); base.Update(gameTime);
} }
} }