Exemple #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);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            foreach (Block b in blocks)
            {
                b.Draw(spriteBatch);
            }
            pad.Draw(spriteBatch);
            ball.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            // TODO: Add your drawing code here

            switch (state)
            {
            case GameState.StartMenu:
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
                theMenu_Manager.Draw_Menu(this.spriteBatch);
                spriteBatch.End();
                break;

            case GameState.NewGame:

                spriteBatch.Begin();
                switch (New_Game_state)
                {
                case NewGameMenu.Normal:
                    ball_1.Draw(this.spriteBatch);
                    paddle.Draw(this.spriteBatch);
                    theBrick_Manager.Draw_Bricks(this.spriteBatch);
                    theScore_Manager.Draw_Score(this.spriteBatch);
                    break;

                case NewGameMenu.Hard:
                    ball_1.Draw(this.spriteBatch);

                    if (Collisions.ballCollided)
                    {
                        ball_2.Draw(this.spriteBatch);
                    }

                    paddle.Draw(this.spriteBatch);
                    theBrick_Manager.Draw_Bricks(this.spriteBatch);
                    theScore_Manager.Draw_Score(this.spriteBatch);
                    break;

                default:
                    theMenu_Manager.Draw_SubMenu(this.spriteBatch);
                    break;
                }

                if (Fade_Controls.fade_done)
                {
                    theMenu_Manager.Draw_FailMenu(this.spriteBatch);
                }

                spriteBatch.End();
                break;


            case GameState.Options:
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
                theMenu_Manager.Draw_OptionsMenu(this.spriteBatch);
                spriteBatch.End();
                break;

            case GameState.Help:
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
                theMenu_Manager.Draw_HelpMenu(this.spriteBatch);
                spriteBatch.End();
                break;

            case GameState.About:
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
                theMenu_Manager.Draw_AboutMenu(this.spriteBatch);
                spriteBatch.End();
                break;

            default:
                break;
            }

            base.Draw(gameTime);
        }