Пример #1
0
        void RemveBoardBorders()
        {
            int minX1 = 4, maxX2 = (Map.Width - 1) - 4;
            int minZ1 = 4, maxZ2 = (Map.Length - 1) - 4;

            int maxX1, minX2, maxZ1, minZ2;

            CountdownMap.CalcBoardExtents(Map.Width, out maxX1, out minX2);
            CountdownMap.CalcBoardExtents(Map.Length, out maxZ1, out minZ2);
            // Adjust coordinates to the borders around the board
            maxX1 -= 2; maxZ1 -= 2; minX2 += 3; minZ2 += 3;

            // Cuboid the borders around game board with air
            Cuboid(minX1, 4, minZ1, maxX2, 4, maxZ1, Block.Air);
            Cuboid(minX1, 4, minZ2, maxX2, 4, maxZ2, Block.Air);
            Cuboid(minX1, 4, minZ1, maxX1, 4, maxZ2, Block.Air);
            Cuboid(minX2, 4, minZ1, maxX2, 4, maxZ2, Block.Air);
            bulk.Flush();
        }
Пример #2
0
        static void MakeSquares(Level lvl)
        {
            int maxX = lvl.Width - 1, maxZ = lvl.Length - 1;

            Cuboid(4, 4, 4, maxX - 4, 4, maxZ - 4, Block.Glass, lvl);

            int begX, endX, begZ, endZ;

            CountdownMap.CalcBoardExtents(lvl.Width, out begX, out endX);
            CountdownMap.CalcBoardExtents(lvl.Length, out begZ, out endZ);

            for (int z = begZ; z <= endZ; z += 3)
            {
                for (int x = begX; x <= endX; x += 3)
                {
                    Cuboid(x, 4, z, x + 1, 4, z + 1, Block.Green, lvl);
                }
            }
        }
Пример #3
0
        void ResetBoard()
        {
            SetBoardOpening(Block.Glass);
            int maxX = Map.Width - 1, maxZ = Map.Length - 1;

            Cuboid(4, 4, 4, maxX - 4, 4, maxZ - 4, Block.Glass);
            squaresLeft.Clear();

            int begX, endX, begZ, endZ;

            CountdownMap.CalcBoardExtents(Map.Width, out begX, out endX);
            CountdownMap.CalcBoardExtents(Map.Length, out begZ, out endZ);

            for (int z = begZ; z <= endZ; z += 3)
            {
                for (int x = begX; x <= endX; x += 3)
                {
                    Cuboid(x, 4, z, x + 1, 4, z + 1, Block.Green);
                    squaresLeft.Add(new SquarePos(x, z));
                }
            }

            bulk.Flush();
        }