Пример #1
0
        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            mGraphics.GraphicsDevice.Clear(Color.CornflowerBlue);

            mSpriteBatch.Begin();
            mMainScreen.Draw(mSpriteBatch, gameTime);
            mSpriteBatch.End();
        }
Пример #2
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();
            }
        }
Пример #3
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(new Color(31, 31, 31));

            spriteBatch.Begin();

            switch (_state)
            {
            case CGameState.MainScreen:
                _mainscreen.Draw(spriteBatch);
                break;

            case CGameState.CreditsScreen:
                _creditsScreen.Draw(spriteBatch);
                break;

            case CGameState.Playing:
                _background_manager.Draw(spriteBatch);
                _portal_manager.Draw(spriteBatch);
                _bullet_manager.Draw(spriteBatch);
                _enemy_managers.Values
                .ToList()
                .ForEach(x => x.Draw(spriteBatch));
                _player.Draw(spriteBatch);
                _energy_storage_manager.Draw(spriteBatch);
                _bullet_hits_enemy.Draw(spriteBatch);
                _powerup_manager.Draw(spriteBatch);

                break;

            case CGameState.Gameover:
                _gameoverscreen.Draw(spriteBatch);
                break;
            }

            spriteBatch.End();


            base.Draw(gameTime);
        }
Пример #4
0
        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            mainScreen.Draw(gameTime, spriteBatch);
        }