示例#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
 public static void ModifyShield(ref Shield shield, SpriteBatch sb,
     Player player1, Texture2D player_shield)
 {
     Color color = new Color(0, 155, 155, 75);
     shield.player1_position.X = player1.PlayerPosition.X +
                                (player_shield.Bounds.X / 2) - 6;
     shield.player1_position.Y = player1.PlayerPosition.Y +
                                    (player_shield.Bounds.Y / 2);
     sb.Draw(player_shield, shield.player1_position, color);
 }
示例#3
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));
        }