Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            CheckInputs(keyBoardReader as IInputMenu);

            switch (currGameState)
            {
            case GameLoop.Menu:
                startMenu.Update(gameTime);
                gameMusic.StopAllSongs();
                level1.Play = false;
                level1.Update(gameTime);

                _cameraAnimation.Zoom = noZoom;                 //Set camera for no zooming
                if (currGameState != GameLoop.Play)             //Checks if gameloop has changed in the past
                {
                    moveHero.CheckMovement(gameTime);
                }
                break;

            case GameLoop.Play:
                _cameraAnimation.Follow(player);
                gameMusic.StartIngameSong();

                level1.Play = true;
                level1.Update(gameTime);

                moveHero.CheckMovement(gameTime);

                CameraZoomIn();
                break;

            case GameLoop.Pause:
                pauseMenu.Update(gameTime);
                gameMusic.StopAllSongs();

                break;

            case GameLoop.Dead:
                deadMenu.Update(gameTime);
                gameMusic.StopIngameSong();
                gameMusic.StopVictorySong();
                gameMusic.StartDeadSong();
                break;

            case GameLoop.End:
                endMenu.Update(gameTime);
                gameMusic.StopIngameSong();
                gameMusic.StopDeadSong();
                gameMusic.StartVictorySong();
                _cameraAnimation.Follow(player);
                level1.Play = true;
                level1.Update(gameTime);

                moveHero.CheckMovement(gameTime);
                CameraZoomOut();

                break;

            case GameLoop.Exit:
                gameMusic.StopAllSongs();
                Exit();
                break;

            default:
                break;
            }

            base.Update(gameTime);
        }