Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            hero       = new Hero(Content, new Vector2(178, 100));
            hero.input = new BedieningPijltjes();


            myBackground = Content.Load <Texture2D>("png/BG");
            mainFrame    = new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);

            menuImage     = Content.Load <Texture2D>("png/BGMenu");
            wonImage      = Content.Load <Texture2D>("png/BGWON");
            diedImage     = Content.Load <Texture2D>("png/BGDead");
            controlsImage = Content.Load <Texture2D>("png/BGControls");
            infoImage     = Content.Load <Texture2D>("png/BGInfo");

            level1 = new Level1(Content, hero);
            level1.CreateLevel(Content);

            level2 = new Level2(Content, hero);
            level2.CreateLevel(Content);

            levelBeginner = new BeginnerLevel1(Content, hero);
            levelBeginner.CreateLevel(Content);

            camera = new Camera();

            backgroundMusic = Content.Load <Song>("Background");
            MediaPlayer.Play(backgroundMusic);
            MediaPlayer.IsRepeating = true;
        }