Exemplo n.º 1
0
 private double calculateTimeFactor(GameTime gameTime)
 {
     double timeFactor = gameTime.ElapsedGameTime.TotalMilliseconds / moveTime.TotalMilliseconds;
     if (timeFactor >= 1)
     {
         timeFactor = 1;
     }
     return timeFactor;
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public void UpdateLogic(GameTime gameTime)
 {
     if (LogicUpdate != null)
     {
         LogicUpdate(gameTime);
     }
     OnLogicUpdate(gameTime);
 }
Exemplo n.º 5
0
        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();
                }
            }
        }