Esempio n. 1
0
    private static float Use(PowerUp.Abilities ability, Paddle paddle, bool begin, bool isServer)
    {
        // Switch of ability:
        switch (ability)
        {
        // If we are using the grow power up, call its respective function.
        case PowerUp.Abilities.Grow:
            if (begin)
            {
                Grow.Begin(paddle);
            }
            else
            {
                Grow.End(paddle);
            }

            return(Grow.Duration);

        // If we are using the shrink power up, call its respective function.
        case PowerUp.Abilities.Shrink:
            if (begin)
            {
                Shrink.Begin(paddle);
            }
            else
            {
                Shrink.End(paddle);
            }

            return(Shrink.Duration);

        // If we are using the confusion power up, call its respective function.
        case PowerUp.Abilities.Confusion:
            if (begin)
            {
                Confusion.Begin(paddle);
            }
            else
            {
                Confusion.End(paddle);
            }

            return(Confusion.Duration);

        // As ricochet is one time use, return zero as the duration and only use on begin.
        case PowerUp.Abilities.Ricochet:
            // Only run on server as this is change to the ball's velocity which the server controls.
            if (isServer && begin)
            {
                Ricochet.Use();
            }

            return(0f);
        }

        return(0f);
    }
	void Start () 
	{
		if (initialVelocity != Vector2.zero)
			rigidbody2D.velocity = initialVelocity;

		m_Ricochet = GetComponent<Ricochet>();
		m_Animator = GetComponent<Animator>();

		if (! prepareDuration.Equals(0)) 
		{
			m_PrepareTime = 0;
		} 
		else 
		{
			activated = true;
		}
	}
    void Start()
    {
        type = editorType;

        if (initialVelocity != Vector2.zero)
        {
            rigidbody2D.velocity = initialVelocity;
        }

        m_Ricochet = GetComponent <Ricochet>();
        m_Animator = GetComponent <Animator>();

        if (!prepareDuration.Equals(0))
        {
            m_PrepareTime = 0;
            Deactivate();
        }
    }
    void Start()
    {
        if (initialVelocity != Vector2.zero)
        {
            rigidbody2D.velocity = initialVelocity;
        }

        m_Ricochet = GetComponent <Ricochet>();
        m_Animator = GetComponent <Animator>();

        if (!prepareDuration.Equals(0))
        {
            m_PrepareTime = 0;
        }
        else
        {
            activated = true;
        }
    }
Esempio n. 5
0
        private int defaultRadius;           // Player spotted radius.
        #endregion
        #endregion

        #region Constructors
        public PowerUp(Game game, Vector2 position, List <TileRef> sheetRefs,
                       int frameWidth, int frameHeight, float layerDepth,
                       float maxLifeTime, PowerUpType type, int amount, float multiplier,
                       SoundEffect pickupSnd, SoundEffect camoSnd, Ricochet newRound)
            : base(game, position, sheetRefs, frameWidth, frameHeight, layerDepth)
        {
            Visible           = true;
            DrawOrder         = 100;
            this.Type         = type;
            this.MaxLifeTime  = maxLifeTime;
            this.Factor       = multiplier;
            this.Amount       = amount;
            this.State        = PowerUpStatus.Deactivated;
            this.newRound     = newRound;
            BoundingRectangle = new Rectangle(
                PixelPosition.ToPoint(),
                new Point(FrameWidth / 8, FrameHeight / 8));

            #region Get Default Values
            TilePlayer          player        = (TilePlayer)Game.Services.GetService(typeof(TilePlayer));
            TilePlayerTurret    playerTurret  = (TilePlayerTurret)Game.Services.GetService(typeof(TilePlayerTurret));
            List <SentryTurret> sentryTurrets = (List <SentryTurret>)Game.Services.GetService(typeof(List <SentryTurret>));

            if (player != null)
            {
                defaultMaxVelocity        = player.MaxVelocity;
                defaultPlayerAcceleration = player.Acceleration;
                defaultPlayerDeceleration = player.Deceleration;
                defaultTurnSpeed          = player.turnSpeed;
            }

            foreach (SentryTurret turret in sentryTurrets)
            {
                if (turret != null)
                {
                    // Finds first enemy tank in list that's not NULL and takes those as default values.
                    defaultPlayerDamageRate = turret.Bullet.playerDamageRate;
                    defaultRadius           = turret.DetectRadius;
                    break;
                }
            }

            if (playerTurret != null)
            {
                defaultSentryDamageRate = playerTurret.Bullet.sentryDamageRate;
                defaultBullet           = playerTurret.Bullet;
                defaultShellSnd         = playerTurret.ShellSound;
            }
            #endregion

            #region Handle Audio
            this.pickupSnd = pickupSnd;
            pickupSndInst  = this.pickupSnd.CreateInstance();
            #endregion

            #region Setup OrbLight
            PenumbraComponent penumbra = Game.Services.GetService <PenumbraComponent>();
            penumbra.Lights.Add(OrbLight);

            switch (type)
            {
            case PowerUpType.Regen:
            case PowerUpType.Heal:
                OrbLight.Color = Color.LimeGreen;
                break;

            case PowerUpType.DefenseBoost:
                OrbLight.Color = Color.LightBlue;
                break;

            case PowerUpType.SpeedBoost:
                OrbLight.Color = Color.Orange;
                break;

            case PowerUpType.ExtraDamage:
                OrbLight.Color = Color.Red;
                break;

            case PowerUpType.Camouflage:
                OrbLight.Color = Color.Purple;
                break;

            default:
                OrbLight.Color = Color.White;
                break;
            }
            #endregion

            #region Setup Duration Bar
            if (Type == PowerUpType.Camouflage)
            {
                durationBar      = new HealthBar(game, CentrePos);
                durationBar.Name = Type.ToString();
                durationBar.txHealthBar.SetData(new[] { durationBarColor });
                AddHealthBar(durationBar);
                Health = (int)Duration;

                this.camoSnd       = camoSnd;
                camoSndInst        = this.camoSnd.CreateInstance();
                camoSndInst.Volume = 0.8f;
            }
            #endregion
        }
    void Start()
    {
        type = editorType;

        if (initialVelocity != Vector2.zero)
            rigidbody2D.velocity = initialVelocity;

        m_Ricochet = GetComponent<Ricochet>();
        m_Animator = GetComponent<Animator>();

        if (! prepareDuration.Equals(0))
        {
            m_PrepareTime = 0;
            Deactivate();
        }
    }
Esempio n. 7
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();
        }