public override void Update(GameTime gameTime)
{
if (_enabled)
{
if (_titleTime >= 0)
{
_titleTime -= 1;
if ((_titleTime == 0) && (_visibility > 0))
{
_bigText = "";
_smallText = "";
_visibility = 0;
_titleTime = -1;
}
if ((_visibility < 0))
{
_visibility += 1;
}
if (_titleTime == 0)
{
_titleTime = 99;
_visibility = 100;
}
if (_visibility > 0)
{
_visibility -= 1;
}
}
for (int i = 0; i < _effects.Count; ++i)
{
if (_effects[i].finished)
{
_effects.RemoveAt(i);
i -= 1;
}
else
{
_effects[i].Update(gameTime);
}
}
if (_fireCount > 0) _fireCount -= Math.Min((uint)gameTime.ElapsedGameTime.Milliseconds, _fireCount);
for (int i = 0; i < _projectiles.Count; ++i)
{
_projectiles[i].Update(gameTime);
}
for (int i = 0; i < _floatnumbers.Count; ++i)
{
if (_floatnumbers[i].Update(gameTime))
{
_floatnumbers.RemoveAt(i);
i -= 1;
}
}
if (!_noMove)
{
if (IsHit(Mouse.GetState().X, Mouse.GetState().Y))
{
_UpdateMouse(new Vector2(Mouse.GetState().X, Mouse.GetState().Y));
if (Mouse.GetState().LeftButton == ButtonState.Pressed)
{
if (!_actors[_playerID].isMoving)
{
_parent.HandleEvent(true, Backend.Events.MoveActor, _playerID, Backend.Map.WhichWayIs(_highlightedTile, _map.actors[_playerID].tile.coords), _map.actors[_playerID].moveIndex, _map.actors[_playerID].tile.coords);
}
}
if (Mouse.GetState().RightButton == ButtonState.Pressed)
{
if (!_actors[_playerID].isMoving)
{
FireProjectile();
}
}
}
}
else
{
if (Mouse.GetState().LeftButton == ButtonState.Released)
{
_noMove = false;
}
}
/* if (Math.Abs(gameTime.TotalGameTime.Milliseconds / 10 - _lastCheck) > 1)
{
_lastCheck = gameTime.TotalGameTime.Milliseconds / 10;*/
// Avoid asynchronous updates, makes for smoother appearance
for (int i = 0; i < _actors.Count; ++i)
{
_actors[i].Update(gameTime);
}
// }
}
}