Exemplo n.º 1
0
        protected override void LoadContent()
        {
            #region music
            if (musicValue == 0)
            {
                backgroundMusic = Content.Load<Song>("Music/DS Main");
                MediaPlayer.Play(backgroundMusic);
                MediaPlayer.IsRepeating = true;
            }
            if (musicValue == 4)
            {
                backgroundMusic = Content.Load<Song>("Music/Throne Room");
                MediaPlayer.Play(backgroundMusic);
                MediaPlayer.IsRepeating = true;
            }
            if (musicValue == 2)
            {
                backgroundMusic = Content.Load<Song>("Music/Armory");
                MediaPlayer.Play(backgroundMusic);
                MediaPlayer.IsRepeating = true;
            }
            if (musicValue == 5)
            {
                backgroundMusic = Content.Load<Song>("Music/Opening");
                MediaPlayer.Play(backgroundMusic);
                MediaPlayer.IsRepeating = true;
            }
            if (musicValue == 3)
            {
                backgroundMusic = Content.Load<Song>("Music/Cell Block");
                MediaPlayer.Play(backgroundMusic);
                MediaPlayer.IsRepeating = true;
            }
            if (musicValue == 1)
            {
                backgroundMusic = Content.Load<Song>("Music/Deep Space - 1st World");
                MediaPlayer.Play(backgroundMusic);
                MediaPlayer.IsRepeating = true;
            }
            #endregion
            if (transitionValue == 0 || transitionValue == 1 || transitionValue == 2 || transitionValue == 3 || transitionValue == 4 || transitionValue == 5)
            {

                fadedelay = 10;
                alpha = 1;
                timer = 0;
                openingspace = false;
                switchcounter = 0;
                bosspoop = 750;
                bossSpeed = 0;
                bossAttack = 1250;
                font = Content.Load<SpriteFont>("Fonts/CreditText");
            }

            #region loadvalue
            if (loadValue == 0)
            {
                gameStart = new Save_Load();
                gameStart.Load();
                levelprogress = gameStart.LoadProgress;
                dude = new Sprite(Content.Load<Texture2D>("Sprites/TheDude"), new Vector2(700, 500), new Vector2(50, 75), ScreenWidth, ScreenHeight, 0, 1, 0);
                wrench[0] = new Sprite(Content.Load<Texture2D>("Sprites/Thewrench"), new Vector2((dude.position.X + (dude.size.X / 2)), (dude.position.Y + (dude.size.Y / 2))), new Vector2(25, 25), ScreenWidth, ScreenHeight, 0, 2, 0);

            }
            if (loadValue == 1)
            {

                border = new TileMap(Content.Load<Texture2D>("Tilemap/shipblock"), Content.Load<Texture2D>("Menu/levelbox"), Content.Load<Texture2D>("Tilemap/electricityleftrightA"), Content.Load<Texture2D>("Tilemap/electicityupdownA"), Content.Load<Texture2D>("Tilemap/Door"), Content.Load<Texture2D>("Switches/ElectricSwitch"), Content.Load<Texture2D>("Switches/TurretSwitch"), Content.Load<Texture2D>("Switches/DoorSwitch"));
                border.loadpts(lvl);
                border.bulletPosition();
                dude = new Sprite(Content.Load<Texture2D>("Sprites/TheDude"), new Vector2(border.start.X, border.start.Y), new Vector2(50, 75), ScreenWidth, ScreenHeight, (int)border.start.Z, 1, 0);

                font = Content.Load<SpriteFont>("Fonts/GameText");
                for (i = 0; i <= 998; i++)
                    wrench[i] = new Sprite(Content.Load<Texture2D>("Sprites/Thewrench"), new Vector2((dude.position.X + (dude.size.X / 2)), (dude.position.Y + (dude.size.Y / 2))), new Vector2(25, 25), ScreenWidth, ScreenHeight, 0, 2, 0);
                for (int j = 0; j < border.counter; j++)
                    bullet[j] = new Sprite(Content.Load<Texture2D>("Sprites/bullet"), new Vector2(border.bulletP[j].X, border.bulletP[j].Y), new Vector2(10, 10), ScreenWidth, ScreenHeight, 0, 2, 0);
            }
            if (loadValue == 2)
            {
                dude = new Sprite(Content.Load<Texture2D>("Sprites/dude"), new Vector2(50, 500), new Vector2(50, 75), ScreenWidth, ScreenHeight, 2, 1, 0);
                border = new TileMap(Content.Load<Texture2D>("Tilemap/shipblock"), Content.Load<Texture2D>("Menu/levelbox"), Content.Load<Texture2D>("Tilemap/electricityleftrightA"), Content.Load<Texture2D>("Tilemap/electicityupdownA"), Content.Load<Texture2D>("Tilemap/Door"), Content.Load<Texture2D>("Switches/ElectricSwitch"), Content.Load<Texture2D>("Switches/TurretSwitch"), Content.Load<Texture2D>("Switches/DoorSwitch"));
                border.loadpts(0);
                font = Content.Load<SpriteFont>("Fonts/LevelText");

            }
            if (loadValue == 3)
            {
                border = new TileMap(Content.Load<Texture2D>("Tilemap/shipblock"), Content.Load<Texture2D>("Menu/levelbox"), Content.Load<Texture2D>("Tilemap/electricityleftrightA"), Content.Load<Texture2D>("Tilemap/electicityupdownA"), Content.Load<Texture2D>("Tilemap/Door"), Content.Load<Texture2D>("Switches/ElectricSwitch"), Content.Load<Texture2D>("Switches/TurretSwitch"), Content.Load<Texture2D>("Switches/DoorSwitch"));
                border.loadpts(lvl);
                border.bulletPosition();
                bossAttack = 0;
                bossmanimage = 0;
                switchcounter = 0;
                bossSpeed = 1;
                bosspoop = 5;
                alpha = 1;
                fadedelay = 100;
                openingspace = false;
                arm = false;
                dude = new Sprite(Content.Load<Texture2D>("Sprites/TheDude"), new Vector2(border.start.X, border.start.Y), new Vector2(50, 75), ScreenWidth, ScreenHeight, (int)border.start.Z, 1, 0);
                bossman = new Sprite(Content.Load<Texture2D>("Sprites/BossMan"), new Vector2(805, 260), new Vector2(150,150), ScreenWidth, ScreenHeight, 3, 1, 0);
                font = Content.Load<SpriteFont>("Fonts/GameText");
                for (i = 0; i <= 998; i++)
                    wrench[i] = new Sprite(Content.Load<Texture2D>("Sprites/Thewrench"), new Vector2((dude.position.X + (dude.size.X / 2)), (dude.position.Y + (dude.size.Y / 2))), new Vector2(25, 25), ScreenWidth, ScreenHeight, 0, 2, 0);
                for (int j = 0; j < border.counter; j++)
                    bullet[j] = new Sprite(Content.Load<Texture2D>("Sprites/bullet"), new Vector2(border.bulletP[j].X, border.bulletP[j].Y), new Vector2(10, 10), ScreenWidth, ScreenHeight, 0, 2, 0);
            }
            #endregion
        }