← Kit de nivelesObjeto 3Dfogon/nivel-plataforma
Plataforma
Arrastrá para girarlo// «Plataforma» · gpt-6-sol (medium)
// A floating-looking platform: a 48x48 slab (x 0..47, y 0..47) 6 blocks thick at the top (z 26..31), with a bright grass top, brown dirt sides and a clean straight edge, held up by four chunky square wooden or stone posts (5x5 blocks) under its four corners, inset 3 blocks from the edges, from z 0 to z 25. Under the slab, a slightly darker underside. The posts have a light top and bottom trim. The space under the slab is open so it reads as a platform you jump onto.
// Four inset supports leave the space beneath the platform open.
const postPositions = [
[3, 3], [40, 3],
[3, 40], [40, 40]
];
for (const [px, py] of postPositions) {
box(px, py, 0, px + 4, py + 25, 0, null); // no-op; posts are built below
box(px, py, 0, px + 4, py + 4, 25, "#a5aaa0");
// Crisp, lighter front and left faces.
box(px, py, 3, px + 4, py, 22, "#b9bcb0");
box(px, py, 3, px, py + 4, 22, "#afb4a8");
// Simple vertical stone joints, kept subtle.
for (let z = 6; z <= 20; z += 7) {
box(px + 1, py, z, px + 3, py, z, "#9ca399");
box(px, py + 1, z + 2, px, py + 3, z + 2, "#999f95");
}
// Light square caps and feet, within the 5×5 footprint.
box(px, py, 0, px + 4, py + 4, 2, "#d0d4c2");
box(px, py, 23, px + 4, py + 4, 25, "#d9ddca");
box(px, py, 0, px + 4, py, 1, "#e4e6d4");
box(px, py, 24, px + 4, py, 25, "#e8ead8");
box(px, py, 2, px + 4, py + 4, 2, "#b6bdaf");
box(px, py, 23, px + 4, py + 4, 23, "#b8c0af");
}
// Exact 48×48 footprint; the bottom face is darker in the open space.
box(0, 0, 26, 47, 47, 26, "#684b36");
box(0, 0, 27, 47, 47, 30, "#925a34");
// Clean, straight dirt faces with restrained variation.
for (let z = 27; z <= 30; z++) {
for (let i = 0; i < 48; i++) {
const fleck = rand() < 0.035;
set(i, 0, z, fleck ? "#bd7942" : "#aa6939");
set(0, i, z, rand() < 0.03 ? "#b4743e" : "#9e6035");
set(i, 47, z, rand() < 0.025 ? "#a66738" : "#85502f");
set(47, i, z, rand() < 0.025 ? "#a46637" : "#8e5530");
}
}
// A continuous, flat grass surface with only a little color variation.
box(0, 0, 31, 47, 47, 31, "#64d447");
for (let y = 0; y < 48; y++) {
for (let x = 0; x < 48; x++) {
const n = rand();
if (n < 0.035) set(x, y, 31, "#80e65a");
else if (n < 0.055) set(x, y, 31, "#50c63c");
}
}import { draw } from "./assets/voxel";
import { nivelPlataforma } from "./assets/nivel-plataforma";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelPlataforma, 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-plataforma
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-plataforma"] })
# Queda en client/assets/nivel-plataforma.ts
# https://fogon.page/object/nivel-plataforma