Exemplo n.º 1
0
        /// <summary>
        /// Laad de content voor elk object.
        /// </summary>
        /// <param name="theContentManager"></param>
        public override void LoadContent(ContentManager theContentManager)
        {
            base.LoadContent(theContentManager);

            background = new ScrollingBackground(Game1.Instance.GraphicsDevice.Viewport);
            background.AddBackground("images/background1");
            background.AddBackground("images/background1");
            background.AddBackground("images/background1");
            background.AddBackground("images/background1");
            background.AddBackground("images/background1");
            background.AddBackground("images/background1");
            background.AddBackground("images/background1");
            background.LoadContent(theContentManager);
            //foreaches kunnen weg!!!z
            foreach (Goomba aGoomba in goombas)
            {
                aGoomba.LoadContent(theContentManager);
            }
            foreach (Koopa aKoopa in koopas)
            {
                aKoopa.LoadContent(theContentManager);
            }
            foreach (Block aBlock in blocks)
            {
                aBlock.LoadContent(theContentManager);
            }
            foreach (Pipe aPipe in pipes)
            {
                aPipe.LoadContent(theContentManager);
            }
            foreach (Ground aGround in ground)
            {
                aGround.LoadContent(theContentManager);
            }
            foreach (Coin aCoin in coins)
            {
                aCoin.LoadContent(theContentManager);
            }
            foreach (Mushroom aMushroom in mushrooms)
            {
                aMushroom.LoadContent(theContentManager);
            }

            player.LoadContent(theContentManager);

            castle.LoadContent(theContentManager);
            castledoor.LoadContent(theContentManager);
            hud = new HUD(new Vector2(0, 20));
            hud.LoadContent(theContentManager);

            life = new Life(new Vector2(0, 20));
            life.LoadContent(theContentManager);

            score1 = new Score(new Vector2(0, 0), 1);
            score1.LoadContent(theContentManager);
            score2 = new Score(new Vector2(0, 0), 2);
            score2.LoadContent(theContentManager);
        }
 public override void LoadContent(ContentManager Content)
 {
     base.LoadContent(Content);
     mBackground = new ScrollingBackground(Game1.Instance.GraphicsDevice.Viewport);
     mBackground.AddBackground("images/Background1");
     mBackground.AddBackground("images/Background2");
     mBackground.LoadContent(Content);
     foreach (Goomba aGoomba in mGoombas)
     {
         aGoomba.LoadContent(Content);
     }
     foreach (MysteryBlock aMysteryBlock in mMysteryBlocks)
     {
         aMysteryBlock.LoadContent(Content);
     }
     foreach (Pipe aPipe in mPipes)
     {
         aPipe.LoadContent(Content);
     }
     mPlayer.LoadContent(Content);
 }