示例#1
0
        public override void Draw(GameTime gameTime)
        {
            Vector4 shipColor = new Vector4(0.5f + ((float)bulletManager.justShot / 15f), 0.5f, 0.5f, 1);

            Game1.texNorm.Parameters["shipColor"].SetValue(shipColor);

            Game1.texNorm.Parameters["shipLight"].SetValue(35 + bulletManager.justShot * 2);

            Game1.texNorm.Parameters["shipPos"].SetValue(Player.get().Position);
            Game1.texNorm.Parameters["vpMatrix"].SetValue(theCamera.ViewMatrix * theCamera.ProjectionMatrix);
            Game1.texNorm.Parameters["wallLight"].SetValue(200);
            Game1.texNorm.Parameters["wallColor"].SetValue(Color.Orange.ToVector4());

            asteroidManager.Draw(gameTime);
            skybox.Draw(gameTime);
            tunnel.Draw(gameTime);
            player.Draw(gameTime);
            bulletManager.Draw(gameTime);
            pgen.Draw(gameTime);
            // Draw all game components
            base.Draw(gameTime);

            if (gameOver)
            {
                // TO DO: Draw the "gameover" text
                String TextToDraw = "Game Over!";
                spriteBatch.DrawString(gameOverFont, TextToDraw,
                                       new Vector2((Game.Window.ClientBounds.Width - 250) / 2, (Game.Window.ClientBounds.Height - 250) / 2),
                                       Color.Yellow);
            }
        }
示例#2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            BulletManager.Draw(spriteBatch);

            base.Draw(spriteBatch);

            FiringArc.Draw(spriteBatch);
        }
示例#3
0
 /// <inheritdoc/>
 public override void Draw(GameTime gameTime)
 {
     bulletManager.Draw(game.spriteBatch);
     playerSystem.Draw(game.spriteBatch);
     enemyManager.Draw(game.spriteBatch);
     sidePanel.Draw(gameTime);
     lifeManager.Draw(game.spriteBatch);
     itemsManager.Draw(game.spriteBatch);
     seismicChargeCountManager.Draw(game.spriteBatch);
     base.Draw(gameTime);
 }
示例#4
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);
        }