← Level pieces 23D assetfogon/nivel-adoquines
Bloque de adoquines
Drag to turn it// «Bloque de adoquines» · gpt-6-sol (medium)
// A square ground tile that tiles seamlessly: a full 48x48 footprint (x 0..47, y 0..47), 8 blocks thick (z 0..7), a perfectly flat solid slab with straight vertical sides and no gaps. The top (z 6..7) is a cobblestone street: rounded grey stones of 3-5 blocks in 3 shades of grey with dark grey 1-block gaps between them in a staggered pattern; the sides show dark compacted earth below (z 0..5) with a grey stone layer at z 5.
// Solid, grid-aligned base: every x/y position is filled from z 0 through 7.
for (let x = 0; x < 48; x++) {
for (let y = 0; y < 48; y++) {
for (let z = 0; z <= 4; z++) {
const earth = z < 2 ? "#604536" : z < 4 ? "#71513d" : "#805d43";
set(x, y, z, earth);
}
set(x, y, 5, "#858c90");
set(x, y, 6, "#555c63");
set(x, y, 7, "#555c63");
}
}
// Eight rows of five-block cobbles, staggered by three blocks.
// The pattern repeats exactly every 48 blocks in both directions.
const stoneShades = ["#c2c8cd", "#aeb7bf", "#969fa8"];
for (let y = 0; y < 48; y++) {
const row = Math.floor(y / 6);
const localY = y % 6;
const stagger = (row % 2) * 3;
for (let x = 0; x < 48; x++) {
const shiftedX = (x - stagger + 48) % 48;
const column = Math.floor(shiftedX / 6);
const localX = shiftedX % 6;
const corner = (localX === 0 || localX === 4) &&
(localY === 0 || localY === 4);
if (localX >= 5 || localY >= 5 || corner) continue;
const shade = stoneShades[(column * 3 + row * 5 + column * row) % 3];
set(x, y, 6, "#777f87");
set(x, y, 7, shade);
}
}import { draw } from "./assets/voxel";
import { nivelAdoquines } from "./assets/nivel-adoquines";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelAdoquines, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: its longest side, in px
// angle: turn on the floor, in radians
// t: seconds; if it moves, that animates it# In a terminal, in the game's folder
fogon assets add nivel-adoquines
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-adoquines"] })
# It lands in client/assets/nivel-adoquines.ts
# https://fogon.page/object/nivel-adoquines