Exemple #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            base.Draw(gameTime);

            _spriteBatch.Begin(transformMatrix: _mainCamera.GetViewMatrix(), samplerState: SamplerState.LinearClamp,
                               blendState: BlendState.AlphaBlend);

            switch (_gameScreen)
            {
            case GameScreen.HomeScreen:
                _homeScreen.Draw(_spriteBatch);
                break;

            case GameScreen.CinematicScreen:
                _cinematicScreen.Draw(_spriteBatch);
                break;

            case GameScreen.InstructionsScreen:
                _instructionScreen.Draw(_spriteBatch);
                break;

            case GameScreen.MainScreen:
                _mainScreen.Draw(_spriteBatch);
                break;

            case GameScreen.GameOverScreen:
                _gameOverScreen.Draw(_spriteBatch);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            _screenFader.Draw(_spriteBatch);

            _spriteBatch.End();

            if (_drawDebug)
            {
                DrawDebug();
            }
        }