time
This commit is contained in:
parent
ec8e0a8cd5
commit
e70cae920c
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue