예제 #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++;
                }
            }
        }
예제 #2
0
파일: ABlock.cs 프로젝트: WeightyOgre/Pixel
        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++;

                }

            }
        }