Наследование: AcademyPopcorn.MovingObject
Пример #1
0
 public override IEnumerable<GameObject> ProduceObjects()
 {
     List<Bullet> produced = new List<Bullet>();
     if (this.shotLoaded)
     {
         Bullet bullet = new Bullet(new MatrixCoords(this.TopLeft.Row + 1, this.TopLeft.Col + this.Width / 2));
         produced.Add(bullet);
         this.shotLoaded = false;
     }
     return produced;
 }
Пример #2
0
 public override IEnumerable<GameObject> ProduceObjects()
 {
     if (fire>0)
     {
         fire--;
         bulet[0]=new Bullet(new MatrixCoords(this.TopLeft.Row,this.TopLeft.Col+this.Width/2));
         return bulet;
     }
     else
     {
         return new List<GameObject>();
     }
 }
Пример #3
0
 public override IEnumerable<GameObject> ProduceObjects()
 {
     List<GameObject> obj = new List<GameObject>();
     if (this.isLoaded == true)
     {
         MatrixCoords bul = this.GetTopLeft();
         bul.Col += this.Width / 2;
         Bullet bullet = new Bullet(bul);
         obj.Add(bullet);
         this.isLoaded = false;
     }
     return obj;
 }
Пример #4
0
 public override IEnumerable<GameObject> ProduceObjects()
 {
     List<Bullet> array = new List<Bullet>();
     if (this.isShootingRacket)
     {
         Bullet firstBullet =
         new Bullet(this.topLeft, new MatrixCoords(-1, 0));
         Bullet secondBullet =
         new Bullet(new MatrixCoords(this.topLeft.Row, this.topLeft.Col + this.Width - 1), new MatrixCoords(-1, 0));
         array.Add(firstBullet);
         array.Add(secondBullet);
     }
     return array;
 }
Пример #5
0
        public override IEnumerable<GameObject> ProduceObjects()
        {
            if (shoots > 0 && produce == true)
            {
                int row = this.TopLeft.Row;
                int col = this.TopLeft.Col;
                List<GameObject> bullets = new List<GameObject>();
                Bullet bullet = new Bullet(new MatrixCoords(row, col));
                bullets.Add(bullet);
                produce = false;    // ?

                return bullets;
            }
            return base.ProduceObjects();
        }
        public override IEnumerable<GameObject> ProduceObjects()
        {
            if (this.CanShoot)
            {
                this.CanShoot = false;

                int col = this.topLeft.Col + (this.Width / 2);
                var bulletTopLeft = new MatrixCoords(this.topLeft.Row, col);
                var bullet = new Bullet(bulletTopLeft);

                return new GameObject[] { bullet };
            }

            return base.ProduceObjects();
        }
Пример #7
0
        public override IEnumerable<GameObject> ProduceObjects()
        {
            if (this.hasFired)
            {
                this.hasFired = false;

                List<Bullet> bullets = new List<Bullet>();

                Bullet bullet = new Bullet(
                    new MatrixCoords(this.TopLeft.Row - 2, this.TopLeft.Col + this.Width / 2));

                bullets.Add(bullet);

                return bullets;
            }
            else
            {
                return base.ProduceObjects();
            }
        }
Пример #8
0
        public override IEnumerable<GameObject> ProduceObjects()
        {
            if (this.charges == 0)
            {
                this.charges = 1;
                List<Bullet> bullets = new List<Bullet>();

                // create a new bullet object
                Bullet bullet = new Bullet(
                    new MatrixCoords(this.TopLeft.Row - 2, this.TopLeft.Col + this.Width / 2));

                // add the bullet to the list of bullets produced
                bullets.Add(bullet);

                return bullets;
            }
            else
            {
                return base.ProduceObjects();
            }
        }