← Kit de nivelesObjeto 3Dfogon/nivel-escalera
Escalera
Arrastrá para girarlo// «Escalera» · gpt-6-sol (medium)
// A modular stone staircase: a full 48x48 footprint (x 0..47, y 0..47). Six solid steps going up toward +y (away from the viewer): each step is 8 blocks deep on y and 8 blocks higher than the last, the full 48 wide on x, so the first step is z 0..7 and the top step reaches z 47 (top at the back). Solid underneath (no gaps), straight vertical sides. The tread of each step is light grey stone with a 1-block darker front edge, the risers are slightly darker grey with brick lines; the side faces show the stepped profile with stone layers.
const stone = "#929ba2";
const tread = "#d3dbe0";
const treadLight = "#dce2e6";
const frontEdge = "#aab5bd";
const riser = "#a2acb4";
const side = "#a9b3ba";
const mortar = "#818c95";
// Continuous floor and enclosed outer faces keep the staircase visually solid.
// The large, invisible interiors are hollow to reduce the block count.
box(0, 0, 0, 47, 47, 0, stone);
for (let step = 0; step < 6; step++) {
const y0 = step * 8;
const top = (step + 1) * 8 - 1;
// Stepped side faces, with horizontal courses and staggered joints.
for (const x of [0, 47]) {
for (let y = y0; y < y0 + 8; y++) {
for (let z = 1; z < top; z++) {
const course = Math.floor(z / 4);
const joint = (y + (course % 2 ? 3 : 0)) % 6 === 0;
set(x, y, z, z % 4 === 0 || joint ? mortar : side);
}
}
}
// Visible eight-block riser at the front of this step.
for (let x = 0; x < 48; x++) {
for (let z = step * 8; z < top; z++) {
const course = Math.floor(z / 4);
const joint = (x + (course % 2 ? 6 : 0)) % 12 === 0;
set(x, y0, z,
z % 4 === 0 || joint ? mortar :
z === top - 1 ? "#bac3c9" : riser
);
}
}
// Sparse supports underneath the tread, hidden inside the outer skin.
for (const x of [8, 18, 28, 38]) {
box(x, y0 + 3, 1, x + 1, y0 + 4, top - 1, stone);
}
// Light stone tread and its one-block darker front edge.
for (let x = 0; x < 48; x++) {
for (let y = y0; y < y0 + 8; y++) {
let color = y === y0
? frontEdge
: y >= y0 + 5 ? treadLight : tread;
if (y !== y0 && rand() < 0.012) color = "#c5cfd5";
set(x, y, top, color);
}
}
}
// Enclose the full-height back without filling the invisible interior.
for (let x = 0; x < 48; x++) {
for (let z = 1; z < 47; z++) {
const course = Math.floor(z / 4);
const joint = (x + (course % 2 ? 6 : 0)) % 12 === 0;
set(x, 47, z, z % 4 === 0 || joint ? mortar : riser);
}
}import { draw } from "./assets/voxel";
import { nivelEscalera } from "./assets/nivel-escalera";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelEscalera, 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-escalera
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-escalera"] })
# Queda en client/assets/nivel-escalera.ts
# https://fogon.page/object/nivel-escalera