Beispiel #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.CornflowerBlue);

            if (screenManager.CurrentGameState == GameState.Game)
            {
                // TODO: Add your drawing code here
                backgroundManager.draw(spriteBatch, camera);
                spriteBatch.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp, null, null, null, Camera.ViewMatrix);


                tiles.Draw(spriteBatch);

                gateManager.draw(spriteBatch);
                pickupManager.draw(spriteBatch);

                player.draw(spriteBatch);

                boss.draw(spriteBatch);

                m_EnemyManager.draw(spriteBatch);

                spriteBatch.End();

                spriteBatch.Begin();

                hud.Draw(spriteBatch, gameTime);

                spriteBatch.End();

                player.drawParticles(spriteBatch);
                boss.drawParticles(spriteBatch);
            }
            else
            {
                spriteBatch.Begin();
                screenManager.Draw(spriteBatch);
                spriteBatch.End();
            }
            base.Draw(gameTime);
        }