Beispiel #1
0
        private void normalGameUpdate(float deltaTime)
        {
            //Update all objects in our list. This is not where physics is evaluated,
            // it is only where object-specific actions are performed, like applying control forces

            Objects.Update(deltaTime);

            PainStaticMaker.Update(deltaTime);
        }
Beispiel #2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            float deltaTime = ((float)gameTime.ElapsedGameTime.TotalMilliseconds) * 0.001f;

            //must call once BEFORE any keyboard/mouse operations
            InputManager.Update(deltaTime);

            updateGameState();

            if (GameState.Mode == GameState.GameMode.EXITED)
            {
                return;
            }
            else if (GameState.Mode == GameState.GameMode.PREGAME)
            {
            }
            else if (GameState.Mode == GameState.GameMode.NORMAL)
            {
                normalGameUpdate(deltaTime);
            }
            else if (GameState.Mode == GameState.GameMode.SHIFTING)
            {
                _shiftInterface.Update(deltaTime);
            }
            else if (GameState.Mode == GameState.GameMode.PAUSED)
            {
                //update stuff for the pause menu
            }
            else if (GameState.Mode == GameState.GameMode.GAMEOVERWIN)
            {
                //quack goes the duck
            }
            else if (GameState.Mode == GameState.GameMode.GAMEOVERLOSE)
            {
                _backgroundMusic.Stop();
                LoseScreen.Update(deltaTime);
                Objects.MainCamera.Update(deltaTime);
                PainStaticMaker.Update(deltaTime);
            }

            base.Update(gameTime);
        }