/// <inheritdoc />
/// <summary>
/// </summary>
/// <param name="dt"></param>
/// <param name="gameTime"></param>
public override void Update(GameTime gameTime)
{
var dt = gameTime.ElapsedGameTime.TotalMilliseconds;
// Tween to target Y positions
Users.ForEach(user =>
{
user.Y = MathHelper.Lerp(user.Y, user.TargetYPosition, (float)Math.Min(dt / 120, 1));
// Tween X Position based on if the scoreboard is hidden
if (ConfigManager.ScoreboardVisible.Value)
{
var target = Team == MultiplayerTeam.Red ? 0 : WindowManager.Width - user.Width;
user.X = MathHelper.Lerp(user.X, target, (float)Math.Min(dt / 120, 1));
}
else
{
var target = Team == MultiplayerTeam.Red ? -user.Width - 10 : WindowManager.Width + user.Width + 10;
user.X = MathHelper.Lerp(user.X, target, (float)Math.Min(dt / 90, 1));
}
user.Visible = user.X >= -user.Width + 10;
});
// Lerp team banner in and out
if (TeamBanner != null)
{
var target = Team == MultiplayerTeam.Red ? 0 : WindowManager.Width - TeamBanner.Width;
TeamBanner.X = MathHelper.Lerp(TeamBanner.X, target, (float)Math.Min(dt / 120, 1));
}
base.Update(gameTime);
}