← Level pieces 23D assetfogon/nivel-tierra
Bloque de tierra
Drag to turn it// «Bloque de tierra» · 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. Plain warm brown dirt all the way through in 3 shades with a light random pattern, a few small grey pebbles and two tiny pale roots showing on the sides; the top is flat with a couple of darker brown patches, no grass.
const light = "#ad7445";
const mid = "#9e653b";
const dark = "#88532f";
// Solid, flat 48×48 tile. Subtle color variation keeps the dirt clean.
for (let z = 0; z < 8; z++) {
for (let y = 0; y < 48; y++) {
for (let x = 0; x < 48; x++) {
const n = rand();
let color;
if (z === 7) {
color = n < 0.13 ? mid : light;
} else if (z >= 4) {
color = n < 0.12 ? light : n < 0.84 ? mid : dark;
} else {
color = n < 0.13 ? mid : dark;
}
set(x, y, z, color);
}
}
}
// Two small, soft-edged darker patches, entirely within the top surface.
for (const [cx, cy, rx, ry] of [[15, 17, 6, 4], [33, 32, 5, 3]]) {
for (let y = cy - ry; y <= cy + ry; y++) {
for (let x = cx - rx; x <= cx + rx; x++) {
const d = ((x - cx) / rx) ** 2 + ((y - cy) / ry) ** 2;
if (d < 0.78 || (d < 1 && rand() < 0.55)) {
set(x, y, 7, rand() < 0.18 ? dark : mid);
}
}
}
}
// A few tiny, flush grey pebbles.
const pebble = "#aaa8a0";
const pebbleShade = "#8f908d";
for (const [x, y] of [[9, 30], [10, 30], [29, 13], [30, 13], [39, 23]]) {
set(x, y, 7, pebble);
}
set(30, 13, 7, pebbleShade);
set(6, 0, 3, pebbleShade);
set(7, 0, 3, pebble);
set(47, 39, 2, pebble);
// Two short pale roots visible on the vertical faces, flush with the slab.
const root = "#dfc395";
for (const [x, z] of [[23, 5], [23, 4], [24, 3], [25, 3], [25, 2]]) {
set(x, 0, z, root);
}
for (const [y, z] of [[12, 5], [12, 4], [13, 4], [14, 3]]) {
set(47, y, z, root);
}import { draw } from "./assets/voxel";
import { nivelTierra } from "./assets/nivel-tierra";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelTierra, 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-tierra
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-tierra"] })
# It lands in client/assets/nivel-tierra.ts
# https://fogon.page/object/nivel-tierra