コード例 #1
0
ファイル: GameRoot.cs プロジェクト: ITSPaul/Games-Fleadh
        protected override void Initialize()
        {
            Window.Position = new Point(
                (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / 2) -
                (graphics.PreferredBackBufferWidth / 2),
                (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / 2) -
                (graphics.PreferredBackBufferHeight / 2));

            new InputEngine(this);

            // Add Camera
            CurrentCamera = new Camera(this, Vector2.Zero,
                                       new Vector2((tileMap.GetLength(1) * tileWidth),
                                                   (tileMap.GetLength(0) * tileHeight)));
            Services.AddService(CurrentCamera);

            #region Create Player Tank
            TilePlayer tankPlayer = new TilePlayer(this, new Vector2(96, 192), new List <TileRef>()
            {
                new TileRef(10, 0, 0),
            }, 64, 64, 0f,
                                                   Content.Load <SoundEffect>("audio/PlayerTankHum"),
                                                   Content.Load <SoundEffect>("audio/PlayerTankTracks"));

            TilePlayerTurret tankPlayerTurret = new TilePlayerTurret(this, tankPlayer.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 1, 0),
            }, 64, 64, 0f,
                                                                     Content.Load <SoundEffect>("audio/PlayerTankShoot"),
                                                                     Content.Load <SoundEffect>("audio/PlayerTankReload"),
                                                                     Content.Load <SoundEffect>("audio/PlayerTurretTurn"),
                                                                     Content.Load <SoundEffect>("audio/TankExplosion"));

            // Add Tank Projectile
            const int PLAYER_BULLET_SPD = 25;

            Projectile bullet = new Projectile(this, "PLAYER", tankPlayerTurret.CentrePos, new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, tankPlayerTurret.Direction, PLAYER_BULLET_SPD,
                                               Content.Load <SoundEffect>("audio/TankShoot"),
                                               Content.Load <SoundEffect>("audio/TankArmorPierce"));

            tankPlayerTurret.AddProjectile(bullet);
            Services.AddService(bullet);

            Services.AddService(tankPlayer);
            Services.AddService(tankPlayerTurret);
            #endregion

            #region Load Animated Sprites
            MuzzleFlash muzzleFlash = new MuzzleFlash(this, tankPlayerTurret.PixelPosition, new List <TileRef>()
            {
                new TileRef(11, 1, 0),
                new TileRef(11, 0, 0),
            }, 64, 64, 0f);

            MuzzleFlashSentry muzzleFlashSentry = new MuzzleFlashSentry(this, tankPlayerTurret.PixelPosition, new List <TileRef>()
            {
                new TileRef(11, 0, 0),
                new TileRef(11, 1, 0),
            }, 64, 64, 0f);

            BulletExplosion bulletExplosionSprite = new BulletExplosion(this, bullet.PixelPosition, new List <TileRef>()
            {
                new TileRef(0, 7, 0),
                new TileRef(1, 7, 0),
                new TileRef(2, 7, 0),
                new TileRef(3, 7, 0),
                new TileRef(4, 7, 0),
                new TileRef(5, 7, 0),
                new TileRef(6, 7, 0),
                new TileRef(7, 7, 0)
            }, 64, 64, 0f);

            TankExplosion tankExplosionSprite = new TankExplosion(this, tankPlayer.PixelPosition, new List <TileRef>()
            {
                new TileRef(0, 6, 0),
                new TileRef(1, 6, 0),
                new TileRef(2, 6, 0),
                new TileRef(3, 6, 0),
                new TileRef(4, 6, 0),
                new TileRef(5, 6, 0),
                new TileRef(6, 6, 0),
                new TileRef(7, 6, 0)
            }, 64, 64, 0f);
            #endregion

            #region Add Animated Sprites to Services
            Services.AddService(muzzleFlash);
            Services.AddService(muzzleFlashSentry);
            Services.AddService(tankExplosionSprite);
            Services.AddService(bulletExplosionSprite);
            #endregion

            #region Create Sentry Tanks
            // Tank Rotations
            const float ANGLE_VERTICAL   = 1.574f;
            const float ANGLE_HORIZONTAL = 3.15f;
            const float ANGLE_DIAG_LEFT  = 2.4f;  // Minus for up left
            const float ANGLE_DIAG_RIGHT = 0.75f; // Minus for up right

            // Y = 325
            Sentry enemyOne = new Sentry(this, new Vector2(700, 200), new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 1",
                                         Content.Load <SoundEffect>("audio/PlayerTankHum"),
                                         Content.Load <SoundEffect>("audio/PlayerTankTracks"),
                                         -ANGLE_DIAG_LEFT);

            //Sentry enemyTwo = new Sentry(this, new Vector2(1180, 237), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 2", ANGLE_VERTICAL);

            //Sentry enemyThree = new Sentry(this, new Vector2(2020, 295), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 3", ANGLE_VERTICAL);

            //Sentry enemyFour = new Sentry(this, new Vector2(2617, 549), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 4", ANGLE_DIAG_LEFT);

            //Sentry enemyFive = new Sentry(this, new Vector2(3490, 42), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 5", ANGLE_DIAG_LEFT);

            //Sentry enemySix = new Sentry(this, new Vector2(3609, 318), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 6", ANGLE_HORIZONTAL);

            //Sentry enemySeven = new Sentry(this, new Vector2(2882, 49), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 7", ANGLE_VERTICAL);

            //Sentry enemyEight = new Sentry(this, new Vector2(3390, 860), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 8", -ANGLE_HORIZONTAL);

            //Sentry enemyNine = new Sentry(this, new Vector2(3455, 1442), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 9", ANGLE_DIAG_LEFT);

            //Sentry enemyTen = new Sentry(this, new Vector2(2845, 1760), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 10", -ANGLE_HORIZONTAL);

            //Sentry enemyEleven = new Sentry(this, new Vector2(2316, 1345), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 11", -ANGLE_HORIZONTAL);

            //Sentry enemyTwelve = new Sentry(this, new Vector2(54, 1916), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 12", -ANGLE_DIAG_RIGHT);

            //Sentry enemyThirteen = new Sentry(this, new Vector2(175, 1188), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 13", ANGLE_DIAG_RIGHT);

            //Sentry enemyFourteen = new Sentry(this, new Vector2(45, 766), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 14", 0f);

            #endregion

            #region Add Sentry's to List
            Sentries.Add(enemyOne);
            //Sentries.Add(enemyTwo);
            //Sentries.Add(enemyThree);
            //Sentries.Add(enemyFour);
            //Sentries.Add(enemyFive);
            //Sentries.Add(enemySix);
            //Sentries.Add(enemySeven);
            //Sentries.Add(enemyEight);
            //Sentries.Add(enemyNine);
            //Sentries.Add(enemyTen);
            //Sentries.Add(enemyEleven);
            //Sentries.Add(enemyTwelve);
            //Sentries.Add(enemyThirteen);
            //Sentries.Add(enemyFourteen);

            Services.AddService(Sentries);
            #endregion

            #region Create Sentry Tank Turrets

            SentryTurret enemyTurretOne = new SentryTurret(this, enemyOne.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 1", -ANGLE_VERTICAL, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                           Content.Load <SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretTwo = new SentryTurret(this, enemyTwo.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 2", ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretThree = new SentryTurret(this, enemyThree.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 3", ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretFour = new SentryTurret(this, enemyFour.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 4", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretFive = new SentryTurret(this, enemyFive.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 5", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretSix = new SentryTurret(this, enemySix.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 6", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretSeven = new SentryTurret(this, enemySeven.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 7", ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretEight = new SentryTurret(this, enemyEight.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 8", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretNine = new SentryTurret(this, enemyNine.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 9", ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretTen = new SentryTurret(this, enemyTen.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 10", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretEleven = new SentryTurret(this, enemyEleven.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 11", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretTwelve = new SentryTurret(this, enemyTwelve.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 12", -ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretThirteen = new SentryTurret(this, enemyThirteen.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 13", ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretFourteen = new SentryTurret(this, enemyFourteen.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 14", 0f, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            #endregion

            #region Add Sentry Turrets to List
            SentryTurrets.Add(enemyTurretOne);
            //SentryTurrets.Add(enemyTurretTwo);
            //SentryTurrets.Add(enemyTurretThree);
            //SentryTurrets.Add(enemyTurretFour);
            //SentryTurrets.Add(enemyTurretFive);
            //SentryTurrets.Add(enemyTurretSix);
            //SentryTurrets.Add(enemyTurretSeven);
            //SentryTurrets.Add(enemyTurretEight);
            //SentryTurrets.Add(enemyTurretNine);
            //SentryTurrets.Add(enemyTurretTen);
            //SentryTurrets.Add(enemyTurretEleven);
            //SentryTurrets.Add(enemyTurretTwelve);
            //SentryTurrets.Add(enemyTurretThirteen);
            //SentryTurrets.Add(enemyTurretFourteen);

            Services.AddService(SentryTurrets);
            #endregion

            #region Create Sentry Tank Projectiles
            int ENEMY_BULLET_SPD = tankPlayerTurret.Bullet.Velocity / 4;

            Projectile enemyBulletOne = new Projectile(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretOne.Direction, ENEMY_BULLET_SPD,
                                                       Content.Load <SoundEffect>("audio/SentryTankShoot"),
                                                       Content.Load <SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletTwo = new Projectile(this, "SENTRY", new Vector2(0,0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretTwo.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletThree = new Projectile(this, "SENTRY", new Vector2(0,0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretThree.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletFour = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretFour.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShoot"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletFive = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretFive.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletSix = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretSix.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShoot"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletSeven = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretSeven.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShoot"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletEight = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretEight.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletNine = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretNine.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletTen = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretTen.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShoot"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletEleven = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretEleven.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletTwelve = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretTwelve.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletThirteen = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretThirteen.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShoot"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletFourteen = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretFourteen.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            List <Projectile> sentryProjectiles = new List <Projectile>()
            {
                enemyBulletOne//, enemyBulletTwo, enemyBulletThree,
                //enemyBulletFour, enemyBulletFive, enemyBulletSix,
                //enemyBulletFive, enemyBulletSeven, enemyBulletEight,
                //enemyBulletNine, enemyBulletTen, enemyBulletEleven,
                //enemyBulletTwelve, enemyBulletThirteen, enemyBulletFourteen
            };

            for (int i = 0; i < SentryTurrets.Count; i++)
            {
                sentryProjectiles[i].explosionLifeSpan = bullet.explosionLifeSpan * 2;
                SentryTurrets[i].AddProjectile(sentryProjectiles[i]);
            }
            #endregion

            #region Add PowerUps
            //PowerUp Speed = new PowerUp(this, new Vector2(200, 192), new List<TileRef>()
            //{
            //    new TileRef(4,3,0),
            //}, 64, 64, 0f, 5, PowerUp.PowerUpType.SpeedBoost, 0, 2,
            //Content.Load<SoundEffect>(@"audio/Resupply"));

            //PowerUp Heal = new PowerUp(this, new Vector2(500, 192), new List<TileRef>()
            //{
            //    new TileRef(4,3,0),
            //}, 64, 64, 0f, 1, PowerUp.PowerUpType.Heal, 50, 1,
            //Content.Load<SoundEffect>(@"audio/Resupply"));

            //PowerUp DefenseBoost = new PowerUp(this, new Vector2(500, 192), new List<TileRef>()
            //{
            //    new TileRef(4,3,0),
            //}, 64, 64, 0f, 60, PowerUp.PowerUpType.DefenseBoost, 0, 2,
            //Content.Load<SoundEffect>(@"audio/Resupply"));

            //PowerUp ExtraDamage = new PowerUp(this, new Vector2(500, 192), new List<TileRef>()
            //{
            //    new TileRef(4,3,0),
            //}, 64, 64, 0f, 60, PowerUp.PowerUpType.ExtraDamage, 0, 2,
            //Content.Load<SoundEffect>(@"audio/Resupply"));

            //PowerUp Camouflage = new PowerUp(this, new Vector2(500, 192), new List<TileRef>()
            //{
            //    new TileRef(4,3,0),
            //}, 64, 64, 0f, 5, PowerUp.PowerUpType.Camouflage, 0, 0,
            //Content.Load<SoundEffect>(@"audio/Resupply"));
            #endregion

            #region Add Crosshair
            new Crosshair(this, new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 3, 0),
            }, 64, 64, 0f);
            #endregion

            #region Set Collisions
            SetCollider(TileType.DIRT);
            SetCollider(TileType.METAL);
            SetTrigger(TileType.DIRT2); // For WIN condition
            #endregion

            base.Initialize();
        }
コード例 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            sFont = Content.Load <SpriteFont>("sFont");

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(spriteBatch);
            Services.AddService(Content.Load <Texture2D>(@"Tiles/tank tiles 64 x 64"));

            // Tile References to be drawn on the Map corresponding to the entries in the defined
            // Tile Map
            // "free", "pavement", "blue steel", "green box", "home"
            TileRefs.Add(new TileRef(4, 2, 0));
            TileRefs.Add(new TileRef(3, 3, 1));
            TileRefs.Add(new TileRef(6, 3, 2));
            TileRefs.Add(new TileRef(6, 2, 3));
            TileRefs.Add(new TileRef(0, 2, 4));

            // Names fo the Tiles

            new SimpleTileLayer(this, backTileNames, tileMap, TileRefs, tileWidth, tileHeight);
            List <Tile> found = SimpleTileLayer.getNamedTiles(backTileNames[(int)TileType.GREENBOX]);

            Projectile playerBullet = new Projectile(this, new List <TileRef>()
            {
                new TileRef(5, 0, 0)
            },
                                                     new AnimateSheetSprite(this, player.PixelPosition, new List <TileRef>()
            {
                new TileRef(7, 0, 0),
                new TileRef(8, 0, 0),
                new TileRef(0, 0, 0),
                new TileRef(1, 0, 0),
                new TileRef(2, 0, 0)
            }, tileWidth, tileHeight, 1), player.PixelPosition, 1);


            player.LoadProjectile(playerBullet);


            //List<Tile> found = SimpleTileLayer.getNamedTiles("green box");
            // added a senytry gameservice similer to a player. 29/11/17 at 13:44
            for (int i = 0; i < found.Count; i++)
            {
                sentrys = new Sentry(this, new Vector2(found[i].X * tileWidth, found[i].Y * tileHeight), new List <TileRef>()
                {
                    new TileRef(20, 2, 0),
                    new TileRef(20, 3, 0),
                    new TileRef(20, 4, 0),
                    new TileRef(20, 5, 0),
                    new TileRef(20, 6, 0),
                    new TileRef(20, 7, 0),
                    new TileRef(20, 8, 0),
                }, 64, 64, 0f);
                sentryList.Add(sentrys);

                Projectile projectile = new Projectile(this, new List <TileRef>()
                {
                    new TileRef(0, 0, 0)
                },
                                                       new AnimateSheetSprite(this, player.PixelPosition, new List <TileRef>()
                {
                    new TileRef(7, 0, 0),
                    new TileRef(8, 0, 0),
                    new TileRef(0, 0, 0),
                    new TileRef(1, 0, 0),
                    new TileRef(2, 0, 0)
                }, tileWidth, tileHeight, 1), player.PixelPosition, 1);

                sentryList[i].loadProjectile(projectile);
                sentryList[i].Health = 2;
            }

            player.playerCrossHair = new CrossHair(this, new List <TileRef>()
            {
                new TileRef(11, 6, 0)
            }, player.PixelPosition, 1);
            // insert soundEffects and songs!
            bulletExplosion = Content.Load <SoundEffect>("SoundEffects/atari_boom");
            Shooting        = Content.Load <SoundEffect>("SoundEffects/atari_boom2");
            backingTrack    = Content.Load <Song>("Songs/bgm_action_1");
        }
コード例 #3
0
        protected override void Initialize()
        {
            Window.Position = new Point(
                (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / 2) -
                (graphics.PreferredBackBufferWidth / 2),
                (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / 2) -
                (graphics.PreferredBackBufferHeight / 2));

            new InputEngine(this);

            // Add Camera
            CurrentCamera = new Camera(this, Vector2.Zero,
                                       new Vector2((tileMap.GetLength(1) * tileWidth),
                                                   (tileMap.GetLength(0) * tileHeight)));
            Services.AddService(CurrentCamera);

            #region Create Player Tank
            TilePlayer tankPlayer = new TilePlayer(this, new Vector2(96, 192), new List <TileRef>()
            {
                new TileRef(10, 0, 0),
            }, 64, 64, 0f,
                                                   Content.Load <SoundEffect>("audio/PlayerTankHum"),
                                                   Content.Load <SoundEffect>("audio/PlayerTankTracks"),
                                                   Content.Load <SoundEffect>("audio/PlayerWarning"),
                                                   Content.Load <SoundEffect>("audio/Heartbeat"));

            TilePlayerTurret tankPlayerTurret = new TilePlayerTurret(this, tankPlayer.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 1, 0),
            }, 64, 64, 0f,
                                                                     Content.Load <SoundEffect>("audio/PlayerTankShoot"),
                                                                     Content.Load <SoundEffect>("audio/PlayerTankReload2"),
                                                                     Content.Load <SoundEffect>("audio/PlayerTankReload"),
                                                                     Content.Load <SoundEffect>("audio/PlayerTurretTurn"),
                                                                     Content.Load <SoundEffect>("audio/TankExplosion"));

            // Add Tank Projectile
            const int PLAYER_BULLET_SPD = 8;

            Projectile bullet = new Projectile(this, "PLAYER", tankPlayerTurret.CentrePos, new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, tankPlayerTurret.Direction, PLAYER_BULLET_SPD,
                                               Content.Load <SoundEffect>("audio/TankShoot"),
                                               Content.Load <SoundEffect>("audio/TankArmorPierce"));
            tankPlayerTurret.AddProjectile(bullet);

            Ricochet ricochetRound = new Ricochet(this, "PLAYER", tankPlayerTurret.CentrePos, new List <TileRef>()
            {
                new TileRef(11, 2, 0),
            }, 64, 64, 0f, tankPlayerTurret.Direction, PLAYER_BULLET_SPD,
                                                  Content.Load <SoundEffect>("audio/TankShoot"),
                                                  Content.Load <SoundEffect>("audio/TankArmorPierce"),
                                                  Content.Load <SoundEffect>("audio/PlayerTankShootAlt"));

            Services.AddService(ricochetRound);
            Services.AddService(bullet);
            Services.AddService(tankPlayer);
            Services.AddService(tankPlayerTurret);
            #endregion

            // Tank Rotations
            const float ANGLE_DOWN       = 1.574f;
            const float ANGLE_RIGHT      = 3.15f;
            const float ANGLE_DIAG_LEFT  = 2.4f;  // Minus for top left
            const float ANGLE_DIAG_RIGHT = 0.75f; // Minus for top right

            #region Create Sentry Tanks
            List <Vector2> SentryPositions = new List <Vector2>
            {
                new Vector2(958, 197),
                new Vector2(200, 768),
                new Vector2(350, 1287),
                new Vector2(2304, 1820),
                new Vector2(3590, 1794),
                new Vector2(3555, 866),
                new Vector2(2580, 180),
                new Vector2(3562, 184),
                new Vector2(2129, 474),
                new Vector2(1374, 251),
            };

            Shuffle(SentryPositions); // Randomize

            Sentry enemyOne = new Sentry(this, SentryPositions[0], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 1",
                                         Content.Load <SoundEffect>("audio/SentryTankHum"),
                                         Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                         -ANGLE_RIGHT);

            Sentry enemyTwo = new Sentry(this, SentryPositions[1], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 2",
                                         Content.Load <SoundEffect>("audio/SentryTankHum"),
                                         Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                         0);

            Sentry enemyThree = new Sentry(this, SentryPositions[2], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 3",
                                           Content.Load <SoundEffect>("audio/SentryTankHum"),
                                           Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                           ANGLE_DIAG_RIGHT);

            Sentry enemyFour = new Sentry(this, SentryPositions[3], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 4",
                                          Content.Load <SoundEffect>("audio/SentryTankHum"),
                                          Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                          -ANGLE_RIGHT);

            Sentry enemyFive = new Sentry(this, SentryPositions[4], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 5",
                                          Content.Load <SoundEffect>("audio/SentryTankHum"),
                                          Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                          -ANGLE_RIGHT);

            Sentry enemySix = new Sentry(this, SentryPositions[5], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 6",
                                         Content.Load <SoundEffect>("audio/SentryTankHum"),
                                         Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                         ANGLE_DOWN);

            Sentry enemySeven = new Sentry(this, SentryPositions[6], new List <TileRef>()
            {
                new TileRef(10, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 7",
                                           Content.Load <SoundEffect>("audio/SentryTankHum"),
                                           Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                           0);

            LightSentry enemyEight = new LightSentry(this, SentryPositions[7], new List <TileRef>()
            {
                new TileRef(10, 6, 0),
            }, 64, 64, 0f, "Enemy Tank 8",
                                                     Content.Load <SoundEffect>("audio/SentryTankHum"),
                                                     Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                                     -ANGLE_RIGHT);

            LightSentry enemyNine = new LightSentry(this, SentryPositions[8], new List <TileRef>()
            {
                new TileRef(10, 6, 0),
            }, 64, 64, 0f, "Enemy Tank 9",
                                                    Content.Load <SoundEffect>("audio/SentryTankHum"),
                                                    Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                                    -ANGLE_RIGHT);

            HeavySentry enemyTen = new HeavySentry(this, SentryPositions[9], new List <TileRef>()
            {
                new TileRef(11, 4, 0),
            }, 64, 64, 0f, "Enemy Tank 10",
                                                   Content.Load <SoundEffect>("audio/SentryTankHum"),
                                                   Content.Load <SoundEffect>("audio/SentryTankTracks"),
                                                   ANGLE_DOWN);

            //Sentry enemyEleven = new Sentry(this, new Vector2(2316, 1345), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 11", -ANGLE_HORIZONTAL);

            //Sentry enemyTwelve = new Sentry(this, new Vector2(54, 1916), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 12", -ANGLE_DIAG_RIGHT);

            //Sentry enemyThirteen = new Sentry(this, new Vector2(175, 1188), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 13", ANGLE_DIAG_RIGHT);

            //Sentry enemyFourteen = new Sentry(this, new Vector2(45, 766), new List<TileRef>()
            //{
            //    new TileRef(10, 4, 0),
            //}, 64, 64, 0f, "Enemy Tank 14", 0f);

            #endregion

            #region Add Sentries to List
            Sentries.Add(enemyOne);
            Sentries.Add(enemyTwo);
            Sentries.Add(enemyThree);
            Sentries.Add(enemyFour);
            Sentries.Add(enemyFive);
            Sentries.Add(enemySix);
            Sentries.Add(enemySeven);
            Sentries.Add(enemyEight);
            Sentries.Add(enemyNine);
            Sentries.Add(enemyTen);
            //Sentries.Add(enemyEleven);
            //Sentries.Add(enemyTwelve);
            //Sentries.Add(enemyThirteen);
            //Sentries.Add(enemyFourteen);

            Services.AddService(Sentries);
            #endregion

            #region Create Sentry Tank Turrets

            SentryTurret enemyTurretOne = new SentryTurret(this, enemyOne.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 1", -ANGLE_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                           Content.Load <SoundEffect>("audio/TankExplosion"));

            SentryTurret enemyTurretTwo = new SentryTurret(this, enemyTwo.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 2", ANGLE_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                           Content.Load <SoundEffect>("audio/TankExplosion"));

            SentryTurret enemyTurretThree = new SentryTurret(this, enemyThree.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 3", -ANGLE_DIAG_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                             Content.Load <SoundEffect>("audio/TankExplosion"));

            SentryTurret enemyTurretFour = new SentryTurret(this, enemyFour.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 4", -ANGLE_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                            Content.Load <SoundEffect>("audio/TankExplosion"));

            SentryTurret enemyTurretFive = new SentryTurret(this, enemyFive.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 5", -ANGLE_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                            Content.Load <SoundEffect>("audio/TankExplosion"));

            SentryTurret enemyTurretSix = new SentryTurret(this, enemySix.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 6", ANGLE_DOWN, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                           Content.Load <SoundEffect>("audio/TankExplosion"));

            SentryTurret enemyTurretSeven = new SentryTurret(this, enemySeven.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 7", 0, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                             Content.Load <SoundEffect>("audio/TankExplosion"));

            LightSentryTurret enemyTurretEight = new LightSentryTurret(this, enemyEight.PixelPosition, new List <TileRef>()
            {
                new TileRef(11, 6, 0),
            }, 64, 64, 0f, "Enemy Tank 8", -ANGLE_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                                       Content.Load <SoundEffect>("audio/TankExplosion"));

            LightSentryTurret enemyTurretNine = new LightSentryTurret(this, enemyNine.PixelPosition, new List <TileRef>()
            {
                new TileRef(11, 6, 0),
            }, 64, 64, 0f, "Enemy Tank 9", -ANGLE_RIGHT, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                                      Content.Load <SoundEffect>("audio/TankExplosion"));

            HeavySentryTurret enemyTurretTen = new HeavySentryTurret(this, enemyTen.PixelPosition, new List <TileRef>()
            {
                new TileRef(11, 5, 0),
            }, 64, 64, 0f, "Enemy Tank 10", ANGLE_DOWN, Content.Load <SoundEffect>("audio/SentryTurretTurn"),
                                                                     Content.Load <SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretEleven = new SentryTurret(this, enemyEleven.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 11", -ANGLE_HORIZONTAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretTwelve = new SentryTurret(this, enemyTwelve.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 12", -ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretThirteen = new SentryTurret(this, enemyThirteen.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 13", ANGLE_VERTICAL, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            //SentryTurret enemyTurretFourteen = new SentryTurret(this, enemyFourteen.PixelPosition, new List<TileRef>()
            //{
            //    new TileRef(10, 5, 0),
            //}, 64, 64, 0f, "Enemy Tank 14", 0f, Content.Load<SoundEffect>("audio/SentryTurretTurn"),
            //Content.Load<SoundEffect>("audio/TankExplosion"));

            #endregion

            #region Add Sentry Turrets to List
            SentryTurrets.Add(enemyTurretOne);
            SentryTurrets.Add(enemyTurretTwo);
            SentryTurrets.Add(enemyTurretThree);
            SentryTurrets.Add(enemyTurretFour);
            SentryTurrets.Add(enemyTurretFive);
            SentryTurrets.Add(enemyTurretSix);
            SentryTurrets.Add(enemyTurretSeven);
            SentryTurrets.Add(enemyTurretEight);
            SentryTurrets.Add(enemyTurretNine);
            SentryTurrets.Add(enemyTurretTen);
            //SentryTurrets.Add(enemyTurretEleven);
            //SentryTurrets.Add(enemyTurretTwelve);
            //SentryTurrets.Add(enemyTurretThirteen);
            //SentryTurrets.Add(enemyTurretFourteen);

            Services.AddService(SentryTurrets);
            #endregion

            #region Create Sentry Tank Projectiles
            int ENEMY_BULLET_SPD = PLAYER_BULLET_SPD - PLAYER_BULLET_SPD / 2;

            Projectile enemyBulletOne = new Projectile(this, "SENTRY", enemyOne.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretOne.Direction, ENEMY_BULLET_SPD,
                                                       Content.Load <SoundEffect>("audio/SentryTankShoot"),
                                                       Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Projectile enemyBulletTwo = new Projectile(this, "SENTRY", enemyTwo.PixelPosition, new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretTwo.Direction, ENEMY_BULLET_SPD,
                                                       Content.Load <SoundEffect>("audio/SentryTankShootAlt"),
                                                       Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Projectile enemyBulletThree = new Projectile(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretThree.Direction, ENEMY_BULLET_SPD,
                                                         Content.Load <SoundEffect>("audio/SentryTankShootAlt"),
                                                         Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Projectile enemyBulletFour = new Projectile(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretFour.Direction, ENEMY_BULLET_SPD,
                                                        Content.Load <SoundEffect>("audio/SentryTankShoot"),
                                                        Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Projectile enemyBulletFive = new Projectile(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretFive.Direction, ENEMY_BULLET_SPD,
                                                        Content.Load <SoundEffect>("audio/SentryTankShootAlt"),
                                                        Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Projectile enemyBulletSix = new Projectile(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretSix.Direction, ENEMY_BULLET_SPD,
                                                       Content.Load <SoundEffect>("audio/SentryTankShoot"),
                                                       Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Projectile enemyBulletSeven = new Projectile(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 2, 0),
            }, 64, 64, 0f, enemyTurretSeven.Direction, ENEMY_BULLET_SPD,
                                                         Content.Load <SoundEffect>("audio/SentryTankShoot"),
                                                         Content.Load <SoundEffect>("audio/TankArmorPierce"));

            Ricochet enemyBulletEight = new Ricochet(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(11, 7, 0),
            }, 64, 64, 0f, enemyTurretEight.Direction, (ENEMY_BULLET_SPD + ENEMY_BULLET_SPD / 3),
                                                     Content.Load <SoundEffect>("audio/SentryTankShootLight"),
                                                     Content.Load <SoundEffect>("audio/TankArmorPierce"), null);

            Ricochet enemyBulletNine = new Ricochet(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(11, 7, 0),
            }, 64, 64, 0f, enemyTurretNine.Direction, (ENEMY_BULLET_SPD + ENEMY_BULLET_SPD / 3),
                                                    Content.Load <SoundEffect>("audio/SentryTankShootLight"),
                                                    Content.Load <SoundEffect>("audio/TankArmorPierce"), null);

            Ricochet enemyBulletTen = new Ricochet(this, "SENTRY", new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 7, 0),
            }, 64, 64, 0f, enemyTurretTen.Direction, PLAYER_BULLET_SPD,
                                                   Content.Load <SoundEffect>("audio/SentryTankShootHeavy"),
                                                   Content.Load <SoundEffect>("audio/TankArmorPierce"), null);

            //Projectile enemyBulletEleven = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretEleven.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletTwelve = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretTwelve.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletThirteen = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretThirteen.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShoot"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            //Projectile enemyBulletFourteen = new Projectile(this, "SENTRY", new Vector2(0, 0), new List<TileRef>()
            //{
            //    new TileRef(10, 2, 0),
            //}, 64, 64, 0f, enemyTurretFourteen.Direction, ENEMY_BULLET_SPD,
            //Content.Load<SoundEffect>("audio/SentryTankShootAlt"),
            //Content.Load<SoundEffect>("audio/TankArmorPierce"));

            List <Projectile> sentryProjectiles = new List <Projectile>()
            {
                enemyBulletOne, enemyBulletTwo, enemyBulletThree,
                enemyBulletFour, enemyBulletFive, enemyBulletSix,
                enemyBulletSeven, enemyBulletEight, enemyBulletNine,
                enemyBulletTen//, enemyBulletEleven, enemyBulletTwelve,
                //enemyBulletThirteen, enemyBulletFourteen
            };

            for (int i = 0; i < SentryTurrets.Count; i++)
            {
                // Shooting Speed
                sentryProjectiles[i].explosionLifeSpan = sentryProjectiles[i].explosionLifeSpan * 2;
                // Bullet Life Span
                sentryProjectiles[i].flyingLifeSpan = sentryProjectiles[i].flyingLifeSpan + 0.25f;
                SentryTurrets[i].AddProjectile(sentryProjectiles[i]);
            }
            Services.AddService(sentryProjectiles);

            // Heavy Tank Turret Bullet NULL FIX
            enemyTurretTen.UpdateProjectile();
            #endregion

            #region Add Tank Crew
            List <Vector2> CrewmanPositions = new List <Vector2>
            {
                new Vector2(165, 1827),
                new Vector2(194, 863),
                new Vector2(2707, 1758),
                new Vector2(3612, 244),
                new Vector2(1306, 152)
            };

            Shuffle(CrewmanPositions);

            #region Tank Wreck Sprites
            TankWreckSprite[] WreckSprites = new TankWreckSprite[CrewmanPositions.Count];
            for (int i = 0; i < CrewmanPositions.Count; i++)
            {
                WreckSprites[i] = new TankWreckSprite(this, CrewmanPositions[i] + new Vector2(10, 6),
                                                      new List <TileRef>()
                {
                    new TileRef(9, 6, 0)
                }, 64, 64, 0f);
            }

            WreckSprites[0].angleOfRotation = -ANGLE_DIAG_RIGHT;
            WreckSprites[1].angleOfRotation = -ANGLE_DIAG_RIGHT;
            WreckSprites[2].angleOfRotation = ANGLE_RIGHT;
            WreckSprites[3].angleOfRotation = ANGLE_RIGHT;
            WreckSprites[4].angleOfRotation = ANGLE_DIAG_RIGHT;
            #endregion

            //PowerUp Heal = new PowerUp(this, new Vector2(500, 192), new List<TileRef>()
            //{
            //    new TileRef(12,2,0),
            //}, 64, 64, 0f, 1, PowerUp.PowerUpType.Heal, 50, 1,
            //Content.Load<SoundEffect>(@"audio/Rescue3"));

            PowerUp Speed = new PowerUp(this, CrewmanPositions[0], new List <TileRef>()
            {
                new TileRef(12, 3, 0)
            }, 64, 64, 0f, 5, PowerUp.PowerUpType.SpeedBoost, 0, 1.1f,
                                        Content.Load <SoundEffect>(@"audio/Rescue1"), null, null);

            PowerUp Regen = new PowerUp(this, CrewmanPositions[1], new List <TileRef>()
            {
                new TileRef(12, 2, 0),
            }, 64, 64, 0f, 1, PowerUp.PowerUpType.Regen, 1, 1,
                                        Content.Load <SoundEffect>(@"audio/Rescue2"), null, null);

            PowerUp DefenseBoost = new PowerUp(this, CrewmanPositions[2], new List <TileRef>()
            {
                new TileRef(12, 1, 0),
            }, 64, 64, 0f, 60, PowerUp.PowerUpType.DefenseBoost, 0, 2,
                                               Content.Load <SoundEffect>(@"audio/Rescue3"), null, null);

            PowerUp ExtraDamage = new PowerUp(this, CrewmanPositions[3], new List <TileRef>()
            {
                new TileRef(12, 0, 0),
            }, 64, 64, 0f, 60, PowerUp.PowerUpType.ExtraDamage, 0, 2,
                                              Content.Load <SoundEffect>(@"audio/Rescue4"), null, ricochetRound);

            SoundEffect CamoSound = Content.Load <SoundEffect>(@"audio/PlayerActiveCamo");

            PowerUp Camouflage = new PowerUp(this, CrewmanPositions[4], new List <TileRef>()
            {
                new TileRef(12, 4, 0),
            }, 64, 64, 0f, (float)CamoSound.Duration.TotalSeconds, PowerUp.PowerUpType.Camouflage, 0, 0,
                                             Content.Load <SoundEffect>(@"audio/Rescue4"), CamoSound, null);

            List <PowerUp> TankCrewmen = new List <PowerUp>()
            {
                Speed, Regen, DefenseBoost, ExtraDamage, Camouflage
            };

            Services.AddService(TankCrewmen);
            #endregion

            #region Add Crosshairs
            new Crosshair(this, new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(10, 3, 0),
            }, 64, 64, 0f);
            new MouseCrosshair(this, new Vector2(0, 0), new List <TileRef>()
            {
                new TileRef(11, 3, 0),
            }, 64, 64, 0f);
            #endregion

            #region Set Collisions
            Services.AddService(Colliders);
            SetCollider(TileType.DIRT);
            SetCollider(TileType.METAL);
            SetTrigger(TileType.DIRT2); // For WIN condition
            #endregion

            base.Initialize();
        }