示例#1
0
        protected void DrawLevel()
        {
            switch (levelNumber)
            {
            case 1:
                levelOne.Draw(spriteBatch, graphics);

                break;

            case 2:
                levelTwo.Draw(spriteBatch, graphics);
                break;

            case 3:
                levelThree.Draw(spriteBatch, graphics);
                break;

            case 4:

                if (!transition)
                {
                    levelFour.DrawConvo(spriteBatch, graphics);
                }
                levelFour.Draw(spriteBatch, graphics);
                break;

            case 5:

                if (!transition)
                {
                    levelFive.DrawConvo(spriteBatch, graphics);
                }

                levelFive.Draw(spriteBatch, graphics);
                break;

            case 6:
                levelSix.Draw(spriteBatch, graphics);
                break;

            case 7:
                levelSeven.Draw(spriteBatch, graphics);
                level7Inst.Play();
                break;

            case 8:
                levelEight.Draw(spriteBatch, graphics);
                break;

            case 9:
                levelNine.Draw(spriteBatch, graphics);
                break;

            case 10:
                levelTen.Draw(spriteBatch, graphics);
                break;

            case 11:
                levelEle.Draw(spriteBatch, graphics);
                break;

            case 12:
                levelTwe.Draw(spriteBatch, graphics);
                break;

            case 13:
                levelTteen.Draw(spriteBatch, graphics);
                break;

            case 14:
                levelFourteen.Draw(spriteBatch, graphics);
                break;

            case 15:
                levelFifteen.Draw(spriteBatch, graphics);
                break;

            case 16:
                levelSixteen.Draw(spriteBatch, graphics);
                break;

            case 17:
                levelSeventeen.Draw(spriteBatch, graphics);
                break;

            default:
                break;
            }


            //spriteBatch.Draw(theOne.Sprite, new Rectangle(theOne.posX, theOne.posY, theOne.Sprite.Width, theOne.Sprite.Height), Color.White);
            if (walkingRight)
            {
                theOneSprRight.Draw(spriteBatch, new Vector2(theOne.posX, theOne.posY));
            }
            else
            {
                theOneSprLeft.Draw(spriteBatch, new Vector2(theOne.posX, theOne.posY));
            }

            if (transition)
            {
                spriteBatch.Draw(transitionBackground, new Rectangle((int)transitionPos.X, (int)transitionPos.Y, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), Color.White);
                if (levelNumber == 10)
                {
                    SongTransition();
                }
            }
        }