public override void LoadContent()
        {
            Rectangle viewport = ScreenManager.Game.Window.ClientBounds;

            //loads the new spritebatch
            spriteBatch = new SpriteBatch(ScreenManager.GraphicsDevice);

            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");
            //loads the video array
            videos = new Video[videoCount];

            safeBounds = new Rectangle(
                (int)(viewport.Width * SafeAreaPortion),
                (int)(viewport.Height * SafeAreaPortion),
                (int)(viewport.Width * (1 - 2 * SafeAreaPortion)),
                (int)(viewport.Height * (1 - 2 * SafeAreaPortion)));

            //loads all arrays
            sensitivityDisplays = new OtherObject[4];
            leftBunkers = new OtherObject[4];
            rightBunkers = new OtherObject[4];
            playerTriggerSensitivitys = new float[4];
            sourceRectangleSen = new Rectangle[4];

            //loads a screenmanager font
            font = ScreenManager.Font;

            //loads the starting up sensitivity source rectangle (the first image on the sprite sheet)
            for (int i = 0; i < 4; i++)
            {
                sourceRectangleSen[i] = new Rectangle(0, 0, 250, 100);
            }
            //loads the starting up left bunker source rectangle from the sprite sheet
            //loads the starting up right bunker source rectangle from the sprite sheet
            sourceRectangleLeft = new Rectangle(658, 3, 90, 75);
            sourceRectangleRight = new Rectangle(488, 3, 90, 75);

            #region LoadXboxControllerTextures
            center = content.Load<Texture2D>("Xboxbutton\\xbox controller-center");
            textureLength = center.Width;
            //the .left component of the picture for the xbox guide button
            left = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (textureLength / 2);
            //the .top component of the picture for the xbox guide button
            top = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (textureLength / 2) - 10;

            p1NotJoined = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP1-notjoined");
            p1Ready = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP1-ready to play");
            p1JoinedNotReady = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP1-joinedbutnotready");

            p2NotJoined = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP2-notjoined");
            p2Ready = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP2-ready to play");
            p2JoinedNotReady = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP2-joinedbutnotready");

            p3NotJoined = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP3-notjoined");
            p3Ready = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP3-ready to play");
            p3JoinedNotReady = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP3-joinedbutnotready");

            p4NotJoined = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP4-notjoined");
            p4Ready = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP4-ready to play");
            p4JoinedNotReady = content.Load<Texture2D>("Xboxbutton\\xboxcontrollerP4-joinedbutnotready");
            #endregion

            #region Load Misc.
            //videos loaded into game
            videos[0] = content.Load<Video>("Video\\54321");
            player = new VideoPlayer();

            //audio engine in game
            audioEngine = new AudioEngine("Content\\Audio\\JAMAudio.xgs");
            waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");

            //loads the character textures
            Sayid = content.Load<Texture2D>("Sprites\\Players\\Sayid\\Images\\Sayid");
            Sir_Edward = content.Load<Texture2D>("Sprites\\Players\\Sir_Edward\\Images\\Sir_Edward");
            Wilhelm = content.Load<Texture2D>("Sprites\\Players\\Wilhelm\\Images\\Wilhelm");
            Juan = content.Load<Texture2D>("Sprites\\Players\\Juan\\Images\\Juan");

            //loads the sprite sheets for the sensitivity display, the left bunker, and the right bunker
            for (int i = 0; i < 4; i++)
            {
                sensitivityDisplays[i] = new OtherObject(content.Load<Texture2D>("Sprites\\Misc\\Sensitivity_Sprite_Sheet"));
                leftBunkers[i] = new OtherObject(content.Load<Texture2D>("Sprites\\Misc\\xboxControllerSpriteSheet"));
                rightBunkers[i] = new OtherObject(content.Load<Texture2D>("Sprites\\Misc\\xboxControllerSpriteSheet"));
            }

            #endregion

            #region StartUp KnickKnacks
            //sleep for a little so the game can load
            Thread.Sleep(1000);
            //resets so xbox doesnt try to catch up with lost time in thread
            ScreenManager.Game.ResetElapsedTime();
            //make sure to set up the new menu entries upon loading
            SetMenuEntryText();
            //locked and loaded, ready to start up game
            soundBank.PlayCue("loadreload2");
            #endregion
        }
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            //loads the sprite sheets for the sensitivity display, the left bunker, and the right bunker

            sensitivityDisplay = new OtherObject(content.Load<Texture2D>("Sprites\\Misc\\Sensitivity_Sprite_Sheet"));
            leftBunker = new OtherObject(content.Load<Texture2D>("Sprites\\Misc\\xboxControllerSpriteSheet"));
            rightBunker = new OtherObject(content.Load<Texture2D>("Sprites\\Misc\\xboxControllerSpriteSheet"));

            sourceRectangleSen = new Rectangle(0, 0, 250, 100);

            backgroundTexture = content.Load<Texture2D>("Background\\background");

            //loads the starting up left bunker source rectangle from the sprite sheet
            //loads the starting up right bunker source rectangle from the sprite sheet
            sourceRectangleLeft = new Rectangle(658, 3, 90, 75);
            sourceRectangleRight = new Rectangle(488, 3, 90, 75);
        }
示例#3
0
        public override void LoadContent()
        {
            if (ScreenManager.Game.Content == null)
                ScreenManager.Game.Content = new ContentManager(ScreenManager.Game.Services, "Content");

            redRectangle = ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Misc\\redRectangle");

            players = new Hero[NumberOfPlayers];
            playerHalos = new OtherObject[NumberOfPlayers];

            shotgunBullets = new ShotgunBullet[numberOfshotgunBullets];
            miniUziBullets = new MiniUziBullet[numberOfminiUziBullets];
            m4Bullets = new M4Bullet[numberOfm4Bullets];
            g36cBullets = new G36CBullet[numberOfg36cBullets];

            zombies = new Zombie[MaxZombies];

            for (int i = 0; i < NumberOfPlayers; i++)
            {

                //Load the texture data from the Sprite folder depending on who the player is
                #region Texture Data
                if (PlayerCharacters[i] == Character.Sayid)
                {
                    players[i] = new Hero(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Sayid\\Images\\Sayid"));
                    playerHalos[i] = new OtherObject(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Sayid\\Halo\\Sayid-Halo"));
                }
                if (PlayerCharacters[i] == Character.Sir_Edward)
                {
                    players[i] = new Hero(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Sir_Edward\\Images\\Sir_Edward"));
                    playerHalos[i] = new OtherObject(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Sir_Edward\\Halo\\Sir_Edward-Halo"));
                }
                if (PlayerCharacters[i] == Character.Wilhelm)
                {
                    players[i] = new Hero(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Wilhelm\\Images\\Wilhelm"));
                    playerHalos[i] = new OtherObject(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Wilhelm\\Halo\\Wilhelm-Halo"));
                }
                if (PlayerCharacters[i] == Character.Juan)
                {
                    players[i] = new Hero(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Juan\\Images\\Juan"));
                    playerHalos[i] = new OtherObject(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Players\\Juan\\Halo\\Juan-Halo"));
                }

                #endregion
                //give a position for the player to start out at
                #region Position
                //bottom left first
                players[i].position = new Vector2(players[i].sprite.Width * xSignedPosition + (totalFieldWidth / 2), players[i].sprite.Height * ySignedPosition + (totalFieldHeight / 2));
                if (xSignedPosition == -1 && ySignedPosition == -1)
                {
                    //then bottom right
                    xSignedPosition *= -1;
                }
                else if (xSignedPosition == 1 && ySignedPosition == -1)
                {
                    //then top right
                    ySignedPosition *= -1;
                }
                else if (xSignedPosition == 1 && ySignedPosition == 1)
                {
                    //then top left
                    xSignedPosition *= -1;
                }
                #endregion
                //give the correct health for the player depending on the handicap
                #region Health
                if (players[i].playerHandicap == Handicap.Easy)
                {
                    players[i].health = 20;
                }
                else if (players[i].playerHandicap == Handicap.Medium)
                {
                    players[i].health = 15;
                }
                else if (players[i].playerHandicap == Handicap.Hard)
                {
                    players[i].health = 10;
                }
                else if (players[i].playerHandicap == Handicap.VeryHard)
                {
                    players[i].health = 5;
                }
                //reference giving origina2 health for sca2e factoring 2ater
                players[i].fullHealth = players[i].health;
                #endregion

                players[i].playerCharacter = PlayerCharacters[i];
                players[i].playerHandicap = PlayerHandicaps[i];
                players[i].triggerSensitivity = sen[i];
                LoadBullets(players[i].playerCharacter);
                players[i].LoadUpBulletManager();

            }

            #region Zombies
            for (int i = 0; i < MaxZombies; i++)
            {
                zombies[i] = new Zombie(ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Zombies\\Images\\zombie1(1)"));
            }
            #endregion

            healthBar = ScreenManager.Game.Content.Load<Texture2D>("Sprites\\Misc\\HealthBar");

            gameBackgroundTexture = ScreenManager.Game.Content.Load<Texture2D>("Background\\GrassBackground");

            Active = true;

            //sleep for a little so the game can load
            Thread.Sleep(1000);
            //resets so xbox doesnt try to catch up with lost time in thread
            ScreenManager.Game.ResetElapsedTime();
        }