Exemple #1
0
        public ABlock(Vector2 aPosition)
        {
            aBlock = new APixel[40, 40];

            blockWidth  = aBlock.GetUpperBound(0);
            blockHeight = aBlock.GetUpperBound(1);

            this.aPosition   = aPosition;
            startingPosition = Convert.ToInt32(this.aPosition.X);

            for (int i = 0; i <= blockWidth; i++)
            {
                for (int j = 0; j <= blockHeight; j++)
                {
                    aBlock[i, j]               = new APixel();
                    aBlock[i, j].active        = true;
                    aBlock[i, j].PixelPosition = aPosition;

                    if (aPosition.X >= startingPosition + blockWidth)
                    {
                        aPosition.X = startingPosition - 1;
                        aPosition.Y++;
                    }

                    aPosition.X++;
                }
            }
        }
Exemple #2
0
        public ABlock(Vector2 aPosition)
        {
            aBlock = new APixel[40,40];

            blockWidth = aBlock.GetUpperBound(0);
            blockHeight = aBlock.GetUpperBound(1);

            this.aPosition = aPosition;
            startingPosition = Convert.ToInt32(this.aPosition.X);

            for (int i = 0; i <= blockWidth; i++)
            {
                for (int j = 0; j <= blockHeight; j++)
                {
                    aBlock[i, j] = new APixel();
                    aBlock[i, j].active = true;
                    aBlock[i, j].PixelPosition = aPosition;

                    if (aPosition.X >= startingPosition + blockWidth)
                    {
                        aPosition.X = startingPosition -1;
                        aPosition.Y++;
                    }

                    aPosition.X++;

                }

            }
        }