public override bool ShouldBeRemoved(Platforms platforms, Unit Unit, GameWindow gameWindow, GameTime gameTime, int shift) { if (!active) { active = (this == platforms.CurrentPlatform(Unit, gameWindow, shift)); } if (active) { timeSinceActivation += gameTime.ElapsedGameTime; } return(timeSinceActivation > maxTime); }
public void SetVelocity(GameWindow gameWindow, Platforms platforms, ref int shift, GameTime gameTime) { velocity.X = baseVelocity; velocity.Y = baseVelocity + 5; Platform platform = platforms.CurrentPlatform(this, gameWindow, shift); if (platform != null) { currentPlatform = platform; platform.MoveUnit(this, gameWindow, platforms, shift); changeShift(ref shift, gameWindow); } currentPlatform.ChangeVelocity(ref velocity); if (IncreaseVelocityBonusChecker == true) { velocity.X += bonusVelocityAcceleration; velocityBonusChecker += gameTime.ElapsedGameTime; if (velocityBonusChecker >= velocityBonusTotalTime) { IncreaseVelocityBonusChecker = false; } } }