Beispiel #1
0
        /// <summary>
        /// Update game state, and then game logic
        /// </summary>
        /// <param name="deltaT">deltaT</param>
        public void Update(double deltaT)
        {
            // init menu --> game
            if ((GameStateManager.StartMode() || GameStateManager.IsEnd()) && KeyPressed.Contains(Keys.Space))
            {
                GameStateManager.StartGame();
                ReleaseKey(Keys.Space);
            }

            // game --> pause ?
            if (GameStateManager.IsInGame())
            {
                if (KeyPressed.Contains(Keys.P))
                {
                    GameStateManager.PausedGame();
                    ReleaseKey(Keys.P);
                }
                if (GameStateManager.IsPaused())
                {
                    return;
                }
            }

            UpdateGameLogic(deltaT);
        }