← Piezas de nivel 2Objeto 3Dfogon/nivel-pared-de-ladrillo-rota
Pared rota
Arrastrá para girarlo// «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");import { draw } from "./assets/voxel";
import { nivelParedDeLadrilloRota } from "./assets/nivel-pared-de-ladrillo-rota";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelParedDeLadrilloRota, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: lo que mide en px su lado más largo
// angle: giro sobre el piso, en radianes
// t: segundos; si se mueve, se anima solo con eso# En una terminal, en la carpeta del juego
fogon assets add nivel-pared-de-ladrillo-rota
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-pared-de-ladrillo-rota"] })
# Queda en client/assets/nivel-pared-de-ladrillo-rota.ts
# https://fogon.page/object/nivel-pared-de-ladrillo-rota