Example #1
0
        /// <summary>
        /// Draws all Entities to the screen
        /// </summary>
        /// <param name="gameTime">Time passed since the last call to Draw.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);


            _spriteBatch.Begin();

            if (_running)
            {
                _player.Draw(_spriteBatch);

                foreach (Projectile t in _projectiles)
                {
                    t.Draw(_spriteBatch);
                }

                foreach (Asteroid asteroid in _asteroids)
                {
                    asteroid.Draw(_spriteBatch);
                }

                foreach (Explosion explosion in _explosions)
                {
                    explosion.Draw(_spriteBatch);
                }

                foreach (Satellite satellite in _enemies)
                {
                    satellite.Draw(_spriteBatch);
                }

                _score.Draw(_spriteBatch);
            }
            else
            {
                _menu.Draw(_spriteBatch);
            }
            _spriteBatch.End();
            base.Draw(gameTime);
        }