Пример #1
0
        private void GameplayLoad()
        {
            spriteBatch = ScreenManager.SpriteBatch;

            gunIconF    = content.Load<Texture2D>(@"PowerUps/GunFieldIcon");
            healthIconF = content.Load<Texture2D>(@"PowerUps/HealthUpgrade");
            shieldIconP = content.Load<Texture2D>(@"PowerUps/Shield");
            shieldIconF = content.Load<Texture2D>(@"PowerUps/ShieldFieldIcon");

            gunSound       = content.Load<SoundEffect>(@"Sounds/shootGun");
            getHealth      = content.Load<SoundEffect>(@"Sounds/grabHealth");
            getShield      = content.Load<SoundEffect>(@"Sounds/grabShield");
            noHealth       = content.Load<SoundEffect>(@"Sounds/noHealth");
            questionNotice = content.Load<SoundEffect>(@"Sounds/notice");

            hudFont    = content.Load<SpriteFont>("HUDFont");
            background = new Background();
            background.Load(ScreenManager.GraphicsDevice,
                                     content.Load<Texture2D>(@"BackgroundImages/BloodVein"),
                                     content.Load<Texture2D>(@"BackgroundImages/BloodCells"));

            player1Texture = content.Load<Texture2D>(@"CharacterImages/Player1");
            jettexture     = content.Load<Texture2D>(@"CharacterImages/Jet1Normal");
            jettexture2    = content.Load<Texture2D>(@"CharacterImages/Jet1Boost");
            playerSize = new Vector2(player1Texture.Width, player1Texture.Height);
            if(!singleMode)
            {
                // TODO: use player1's texture for now, might make another for player2 later.
                // player2Texture = Content.Load<Texture2D>(@"CharacterImages/Player2");
            }
            player1 = new Player(player1Texture, jettexture, jettexture2, initialPlayerPosition,
                                    playerVelocity, playerSize, windowSize, player1CurrentScore,
                                                                          player1CurrentHealth);

            enemyTexList.Add(content.Load<Texture2D>(@"CharacterImages/VirusGreen"));
            enemyTexList.Add(content.Load<Texture2D>(@"CharacterImages/VirusPurple"));
            enemyTexList.Add(content.Load<Texture2D>(@"CharacterImages/ShockingBloodCell"));

            GameUpdate.AddEnemy(enemyList, numEnemies, numMoveStrategies, enemyTexList,
                                                                  windowSize, player1);

            bulletTexList.Add(content.Load<Texture2D>(@"BulletImages/Bullets"));
            shield = new Shield(new Vector2(0, 0));
        }
Пример #2
0
        private void GameplayLoad()
        {
            spriteBatch = ScreenManager.SpriteBatch;

            healthIconF = content.Load<Texture2D>(@"PowerUps/HealthUpgrade");
            shieldIconF = content.Load<Texture2D>(@"PowerUps/ShieldFieldIcon");
            shieldIconP = content.Load<Texture2D>(@"PowerUps/Shield");
            gunIconF = content.Load<Texture2D>(@"PowerUps/GunFieldIcon");

            gunSound = content.Load<SoundEffect>(@"Sounds/shootGun");
            getHealth = content.Load<SoundEffect>(@"Sounds/grabHealth");
            getShield = content.Load <SoundEffect>(@"Sounds/grabShield");
            noHealth = content.Load<SoundEffect>(@"Sounds/noHealth");
            questionNotice = content.Load<SoundEffect>(@"Sounds/notice");

            hudFont = content.Load<SpriteFont>("HUDFont");
            background = new Background();
            background.Load(ScreenManager.GraphicsDevice, content.Load<Texture2D>("BloodVein"), content.Load<Texture2D>("BCbg"));

            player1Texture = content.Load<Texture2D>(@"CharacterImages/Player1");
            jettexture = content.Load<Texture2D>(@"CharacterImages/Character Jets");
            jettexture2 = content.Load<Texture2D>(@"CharacterImages/Character Jets2");
            playerSize = new Vector2(player1Texture.Width, player1Texture.Height);
            if(!singleMode)
            {
                // TODO: use player1's texture for now, might make another for player2 later.
                // player2Texture = Content.Load<Texture2D>(@"CharacterImages/Player2");
            }
            player1 = new Player(player1Texture, jettexture, jettexture2, initialPlayerPosition,
                                                        playerVelocity, playerSize, windowSize);

            enemyTexList.Add(content.Load<Texture2D>(@"CharacterImages/Boss"));
            enemyTexList.Add(content.Load<Texture2D>(@"CharacterImages/PurpleVirus"));
            enemyTexList.Add(content.Load<Texture2D>(@"CharacterImages/ShockingInfectedBloodCell"));

            Vector2 charSize = new Vector2(enemyTexList[0].Width , enemyTexList[0].Height);
            int count = 0;
            while(count < numEnemies)
            {
                int r = RandomGenerator.RandomInt(enemyTexList.Count);
                enemyList.Add(new Enemy(RandomGenerator.RandomMoveStrategy(numMoveStrategies),
                                        RandomGenerator.RandomPosition(windowSize, charSize),
                                        windowSize,
                                        100,
                                        RandomGenerator.RandomEnemySize(false)));
                switch (r)
                {
                    case 0: enemyList[count].InitializeAnim(enemyTexList[0], 2, 400, 64, 64);
                        break;
                    case 1: enemyList[count].InitializeAnim(enemyTexList[1], 8, 200, 46, 50);
                        break;
                    case 2: enemyList[count].InitializeAnim(enemyTexList[2], 4, 150, 70, 50);
                        break;
                }
                count++;
            }
            bulletTexList.Add(content.Load<Texture2D>(@"BulletImages/Bullets"));
            shield = new Shield(new Vector2(0, 0));
        }