Beispiel #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            //Draw background
            spriteBatch.Begin();
            //spriteBatch.Draw(background, GraphicsDevice.Viewport.Bounds, Color.White);
            currentBackground.Draw(gameTime, spriteBatch);
            spriteBatch.End();

            switch (gameState)
            {
            case GameState.Menu:
                spriteBatch.Begin();
                menu.Draw(spriteBatch);
                spriteBatch.End();

                break;

            case GameState.Game:
                spriteBatch.Begin();
                thisIsOurGame.Draw(gameTime, spriteBatch);
                //PlayerOne.Draw(gameTime, spriteBatch);
                //PlayerTwo.Draw(gameTime, spriteBatch);
                //if (levelP1 != null)
                //    levelP1.Draw(gameTime, spriteBatch);
                //if (levelP2 != null)
                //    levelP2.Draw(gameTime, spriteBatch);
                spriteBatch.End();

                //if (levelP1 != null && !levelP1.isPaused)
                //    levelP1.DrawExplosions();
                //if (levelP2 != null && !levelP2.isPaused)
                //    levelP2.DrawExplosions();


                break;
            }


            base.Draw(gameTime);
        }