Exemple #1
0
        public void FireSpecialAttack(BulletFactory factory)
        {
            Vector2 direction  = new Vector2(0, 1);
            Vector2 currentPos = this.entPosition;

            currentPos.X -= 140;
            currentPos.Y += 64;

            // this function calls the CreateBullet pattern 8 times passing the modified spawn position each time then calls Create special bullet

            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));
            currentPos.X += 40;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Yellow, currentPos, direction, 0, this.bulletStrat));

            currentPos.X -= 170;
            currentPos.Y -= 96;
            Property.enemyBullets.Add(factory.CreateBullet(Property.BulletType.Special, currentPos, direction, 0, this.bulletStrat));
        }
Exemple #2
0
        public virtual Bullet CreateBullet(Property.BulletType t, float angle, BulletFactory factory)
        {
            Vector2 direction = new Vector2(0, 0);


            return(factory.CreateBullet(t, this.entPosition, direction, (float)3.15, bulletStrat));
        }
Exemple #3
0
 public Bullet Shoot()
 {
     //this.entPosition
     return(gun.CreateBullet(Property.BulletType.Green, new Vector2(this.entPosition.X, (this.entPosition.Y - 100)), new Vector2(0, -1), 0, 0));
 }
Exemple #4
0
 public Bullet Shoot()
 {
     return(gun.CreateBullet(Game.BulletType.Yellow, this.entPosition));
 }
Exemple #5
0
        public Bullet CreateBullet(Property.BulletType t, Vector2 pos, Vector2 dir, float angle, int movementPattern)
        {
            Bullet newBullet = bulletFactory.CreateBullet(t, pos, dir, angle, movementPattern);  // A unique ID must be set in the factory

            return(newBullet);
        }