fogón

← Level pieces 23D assetfogon/nivel-pared-de-ladrillo-rota

Pared rota

by fogonCC014402 blocks
Pared rotaDrag to turn it
// «Pared rota» · gpt-6-sol (medium)
// A modular wall segment: exactly 48 blocks long on x (x 0..47), 10 thick on y (y 19..28), 40 tall, with flat clean ends so segments join seamlessly. A ruined red brick wall: red bricks in 3 shades with light mortar lines, but the top edge is broken and jagged (heights varying from 26 to 40), a ragged hole about 10 wide in the middle at mid height, and a few loose bricks lying on the ground in front at z 0.

const brick = ["#d65342", "#e66b4d", "#b94339"];
const mortar = "#efb79c";
const darkMortar = "#d99a82";

const heights = [
  35,35,35,35, 37,37,37,37, 33,33,33,
  30,30,30,30, 34,34,34,34, 28,28,28,
  26,26,26,26, 31,31,31,31, 35,35,35,35,
  40,40,40,40, 36,36,36, 31,31,31,
  35,35,35,35
];

function inHole(x, z) {
  if (z === 12) return x >= 21 && x <= 27;
  if (z >= 13 && z <= 15) return x >= 19 && x <= 29;
  if (z >= 16 && z <= 19) return x >= 18 && x <= 29;
  if (z >= 20 && z <= 22) return x >= 19 && x <= 28;
  if (z === 23) return x >= 21 && x <= 26;
  return false;
}

for (let x = 0; x < 48; x++) {
  for (let z = 0; z < heights[x]; z++) {
    if (inHole(x, z)) continue;

    const course = Math.floor(z / 4);
    const offset = course % 2 ? 4 : 0;
    const seam = (x + offset) % 8 === 0;
    const joint = z % 4 === 0;
    const shade = brick[(Math.floor((x + offset) / 8) + course * 2) % 3];

    for (let y = 19; y <= 28; y++) {
      // Recess the lowest front row, leaving room for fallen bricks.
      if (z < 3 && y < 22 && x > 0 && x < 47) continue;

      const face = y === 19 || y === 28;
      let color = face
        ? (joint ? mortar : seam ? darkMortar : shade)
        : (joint ? "#cc927e" : "#b9473b");

      if (face && !joint && !seam && z % 4 === 1) {
        color = ["#e36349", "#f07854", "#cb4c3e"][
          (Math.floor((x + offset) / 8) + course * 2) % 3
        ];
      }

      // Dark chipped brick edges around the opening.
      if (face && !inHole(x, z) &&
          (inHole(x - 1, z) || inHole(x + 1, z) ||
           inHole(x, z - 1) || inHole(x, z + 1)) &&
          !joint) {
        color = "#a83d35";
      }

      // Sunlit, uneven upper surface.
      if (z === heights[x] - 1) color = y === 19 ? "#f1825a" : "#d9674c";

      set(x, y, z, color);
    }
  }
}

// Distinct loose bricks resting in the recessed space in front.
function fallenBrick(x0, y0, x1, y1, h, top, side) {
  box(x0, y0, 0, x1, y1, h - 1, side);
  box(x0, y0, h, x1, y1, h, top);
  for (let x = x0; x <= x1; x++) set(x, y0, h - 1, "#ee7452");
}

fallenBrick(5, 19, 10, 21, 1, "#f08057", "#c94e3d");
fallenBrick(15, 19, 18, 20, 0, "#e36b4c", "#bd4538");
fallenBrick(32, 19, 38, 21, 1, "#ed7952", "#c54a3c");
fallenBrick(40, 20, 44, 21, 0, "#dc6045", "#b64137");