Esempio n. 1
0
        private void UpdateWeapon()
        {
            if (patterns[curFiringPatternIndex].numberOfShots == 0)
            {
                return;
            }

            if (numberOfTimesShot >= patterns[curFiringPatternIndex].numberOfShots)
            {
                numberOfTimesShot     = 0;
                curFiringPatternIndex = (curFiringPatternIndex + 1) % patterns.Length;
                untilNextShot         = patterns[curFiringPatternIndex].shotDrops;
                BulletFactory nextBF = patterns[curFiringPatternIndex].factory;
                if (nextBF is MovingBulletFactory)
                {
                    ((MovingBulletFactory)nextBF).ResetMovePath();
                }
            }
        }
        private static BulletFactory makeBossGun2()
        {
            // BulletFactory[] factories = new BulletFactory[]{makeDefaultShotgun(), makeSurroundBulletFactory(), makeBossSpiralFactory()};
            BulletFactory[]             factories = new BulletFactory[] { makeBossSpiralFactory(), makeDefaultShotgun(), makeSurroundBulletFactory() };
            ChangingBulletFactoryData[] datas     = new ChangingBulletFactoryData[factories.Length];

            int i = 0;

            foreach (var factory in factories)
            {
                datas[i] = new ChangingBulletFactoryData(factories[i], 1);
                i++;
            }

            datas[0].numberOfShots = 100;
            datas[0].shotDrops     = 1;
            datas[1].numberOfShots = 3;
            datas[1].shotDrops     = 100;
            datas[2].numberOfShots = 3;
            datas[2].shotDrops     = 100;

            return(new ChangingBulletFactory(datas));
        }
 public BulletWaveWithCollidingBullet(BulletFactory bulletWave, BulletFactory collidingBullets)
 {
     this.bulletWave       = bulletWave;
     this.collidingBullets = collidingBullets;
 }
Esempio n. 4
0
 public SurroundBulletFactory(int amountOfBullets, BulletFactory bulletsToSpawn)
 {
     this.amountOfBullets = amountOfBullets;
     this.bulletsToSpawn  = bulletsToSpawn;
 }
Esempio n. 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="numberOfShots"></param>
 /// <param name="shotDrops"></param> Shoots every xth shot. 10 will shoot every 10th shot. 1 will shoot every shot
 public ChangingBulletFactoryData(BulletFactory factory, int numberOfShots, int shotDrops = 1)
 {
     this.factory       = factory;
     this.numberOfShots = numberOfShots;
     this.shotDrops     = shotDrops;
 }
 public MovingBulletFactory(BulletFactory bulletFactory, ILocationEquation pathToFollow)
 {
     this.pathLocationEquation = pathToFollow;
     this.path          = new BasicPath(pathToFollow, Vector2.Zero, 0, 1);
     this.bulletFactory = bulletFactory;
 }
 public CollidingBulletFactory(BulletFactory factory)
 {
     this.factory = factory;
 }