示例#1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Set up HUD
            hud.LoadFont(Content);
            hud.setWorld(TheLevelNumberVariableWithADescriptiveNameThatIsWithTheOtherVariables);
            hud.setTotalLevel(LevelFile.Length);

            //Load first level
            List <String[]> map = LevelLoader.Instance.loadLevel(this.LevelChanger());

            //Load all factory resources
            SoundEffectFactory.Instance.LoadAllSoundEffects(Content);
            MarioFactory.Instance.LoadAllTextures(Content);
            ItemFactory.Instance.LoadAllTextures(Content);
            HiddenLevelItemFactory.Instance.LoadAllTextures(Content);
            ObjectFactory.Instance.LoadAllTextures(Content);
            EnemyFactory.Instance.LoadAllTextures(Content);
            ProjectileFactory.Instance.LoadAllTextures(Content);
            LevelFactory.Instance.LoadAllTextures(Content);
            ZombieFactory.Instance.LoadAllTextures(Content);
            NightmareEnemyFactory.Instance.LoadAllTextures(Content);

            //Setup music
            marioTheme              = Content.Load <Song>("smbMarioGameTheme");
            nightmareTheme          = Content.Load <Song>("nightmareHalloweenTheme");
            nightmareGameOver       = Content.Load <Song>("nightmareSawThemeGameOver");
            nightmareThemeIsStarted = false;

            //Prep first menu
            MediaPlayer.IsRepeating = true;
            menuItems = LevelFactory.Instance.GetMenuItems();
            bg        = new Scrolling(Content, new Rectangle(0, 0, 800, 512));

            Character = new Mario(marioStartPosition, this);
            castle    = LevelFactory.Instance.CreateCastle(BackgroundCreator.LoadCastle());

            //Background elements//
            background = Content.Load <Texture2D>("background");
        }
示例#2
0
 private void ScrollableBackground()
 {
     bg = new Scrolling(g.Content.Load <Texture2D>("nightmare"), new Rectangle(0, 0, 800, 450));
 }