private double calculateTimeFactor(GameTime gameTime) { double timeFactor = gameTime.ElapsedGameTime.TotalMilliseconds / moveTime.TotalMilliseconds; if (timeFactor >= 1) { timeFactor = 1; } return timeFactor; }
public void UpdateFloorRotation(int angle, GameTime gameTime) { double timeFactor = gameTime.ElapsedGameTime.TotalMilliseconds / rotateTime.TotalMilliseconds; if (timeFactor >= 1) { timeFactor = 1; } currentAngle = calculateAngle(timeFactor, currentAngle, (double)angle); }
public void Update(RobotPosition position, GameTime gameTime) { int row = position.Row; int column = position.Column; double heightPosition = LevelRenderer.GetTileHeightOpenGLUnits(position.Height); double timeFactor = calculateTimeFactor(gameTime); xPosition = calculatePosition(timeFactor, xPosition, row * LevelRenderer.TileSize); yPosition = calculatePosition(timeFactor, yPosition, heightPosition); zPosition = calculatePosition(timeFactor, zPosition, column * LevelRenderer.TileSize); rotation = calculatePosition(timeFactor, rotation, (int)position.Direction); }
public void UpdateLogic(GameTime gameTime) { if (LogicUpdate != null) { LogicUpdate(gameTime); } OnLogicUpdate(gameTime); }
public void OnLogicUpdate(GameTime gameTime) { if (GameMode == GameModes.Play) { HUD.Message.FirstLine = "Nazwa poziomu: " + Level.Manager.CurrentLevelName; if (Level.IsLevelCompleted) { System.Threading.Thread.Sleep(200); MainProgram.Clear(); FunctionOneCommands.Clear(); HUD.ClearCommands(); Level.LoadNextLevel(); } } }