Exemplo n.º 1
0
         public override IEnumerable<GameObject> ProduceObjects()
        {
            List<GameObject> produced = new List<GameObject>();
            MatrixCoords speed = new MatrixCoords(0, 0);

            if (this.IsDestroyed)
            {
                //upper
                for (int col = -1; col <= 1; col++)
                {
                    MatrixCoords tempTopLeft = new MatrixCoords(this.topLeft.Row - 1, this.topLeft.Col + col);
                    ExplosionUnit unit = new ExplosionUnit(tempTopLeft, speed);
                    produced.Add(unit);
                }

                //lower
                for (int col = -1; col <= 1; col++)
                {
                    MatrixCoords tempTopLeft = new MatrixCoords(this.topLeft.Row + 1, this.topLeft.Col + col);
                    ExplosionUnit unit = new ExplosionUnit(tempTopLeft, speed);
                    produced.Add(unit);
                }

                //left
                MatrixCoords leftTopLeft = new MatrixCoords(this.topLeft.Row, this.topLeft.Col - 1);
                ExplosionUnit leftUnit = new ExplosionUnit(leftTopLeft, speed);
                produced.Add(leftUnit);

                //right
                MatrixCoords rightTopLeft = new MatrixCoords(this.topLeft.Row, this.topLeft.Col + 1);
                ExplosionUnit rightUnit = new ExplosionUnit(rightTopLeft, speed);
                produced.Add(rightUnit);
            }

            return produced;
        }
Exemplo n.º 2
0
        public override IEnumerable <GameObject> ProduceObjects()
        {
            List <GameObject> produced = new List <GameObject>();
            MatrixCoords      speed    = new MatrixCoords(0, 0);

            if (this.IsDestroyed)
            {
                //upper
                for (int col = -1; col <= 1; col++)
                {
                    MatrixCoords  tempTopLeft = new MatrixCoords(this.topLeft.Row - 1, this.topLeft.Col + col);
                    ExplosionUnit unit        = new ExplosionUnit(tempTopLeft, speed);
                    produced.Add(unit);
                }

                //lower
                for (int col = -1; col <= 1; col++)
                {
                    MatrixCoords  tempTopLeft = new MatrixCoords(this.topLeft.Row + 1, this.topLeft.Col + col);
                    ExplosionUnit unit        = new ExplosionUnit(tempTopLeft, speed);
                    produced.Add(unit);
                }

                //left
                MatrixCoords  leftTopLeft = new MatrixCoords(this.topLeft.Row, this.topLeft.Col - 1);
                ExplosionUnit leftUnit    = new ExplosionUnit(leftTopLeft, speed);
                produced.Add(leftUnit);

                //right
                MatrixCoords  rightTopLeft = new MatrixCoords(this.topLeft.Row, this.topLeft.Col + 1);
                ExplosionUnit rightUnit    = new ExplosionUnit(rightTopLeft, speed);
                produced.Add(rightUnit);
            }

            return(produced);
        }