← GranjaObjeto 3Dfogon/buzon-de-campo
Buzón de campo
Arrastrá para girarlo// «Buzón de campo» · gpt-6-sol (medium)
// A rural mailbox on a wooden post: a classic tunnel-shaped mailbox (flat bottom, rounded top) painted red with a white stripe, a small front door, a raised yellow flag on the side, mounted on a sturdy brown wooden post stuck in a small patch of grass with a few flowers.
// Sunny patch of countryside grass
for (let x = 5; x <= 43; x++) {
for (let y = 5; y <= 42; y++) {
const dx = (x - 24) / 19, dy = (y - 24) / 18;
if (dx * dx + dy * dy < 1.02 + (rand() - 0.5) * 0.13) {
set(x, y, 0, rand() < 0.25 ? "#65bd3e" : "#72ca46");
if (rand() < 0.32) set(x, y, 1, rand() < 0.5 ? "#81d650" : "#5dbb3b");
if (rand() < 0.045) set(x, y, 2, "#54ae39");
}
}
}
// Sturdy square timber post, with visible grain
box(20, 20, 2, 27, 27, 25, "#966037");
box(20, 20, 2, 20, 27, 25, "#ad7240");
box(21, 20, 2, 27, 20, 25, "#b97c45");
box(27, 21, 2, 27, 27, 25, "#75492d");
for (let z = 4; z < 25; z++) {
if (rand() < 0.48) line(22 + Math.floor(rand() * 4), 19, z, 22 + Math.floor(rand() * 4), 19, z + 1, 0, "#cb8d50");
if (rand() < 0.32) set(19, 22 + Math.floor(rand() * 4), z, "#81502f");
}
box(17, 14, 23, 31, 35, 25, "#8e592f");
box(17, 14, 25, 31, 35, 25, "#bd8044");
box(17, 14, 23, 31, 14, 24, "#a66b38");
// Flat-bottomed red mailbox, with a rounded tunnel roof
box(12, 10, 26, 36, 37, 31, "#c93236");
box(12, 10, 26, 36, 37, 26, "#a92330");
for (let z = 32; z <= 40; z++) {
for (let x = 12; x <= 36; x++) {
const u = (x - 24) / 12;
const v = (z - 31) / 9;
if (u * u + v * v <= 1.02) {
box(x, 10, z, x, 37, z,
z >= 38 ? "#f0544c" : x < 19 ? "#dc393a" : "#e74440");
}
}
}
// Dark lower edge and crisp white stripe along both sides
for (let y = 11; y <= 37; y++) {
box(12, y, 27, 12, y, 27, "#ae2730");
box(36, y, 27, 36, y, 27, "#ae2730");
box(12, y, 29, 12, y, 30, "#fff5dd");
box(36, y, 29, 36, y, 30, "#fff5dd");
if (rand() < 0.14) set(36, y, 31, "#f1564c");
}
box(13, 37, 26, 35, 38, 27, "#a5222e");
// White-trimmed front door follows the arch
for (let x = 12; x <= 36; x++) {
for (let z = 26; z <= 40; z++) {
const inside = z <= 31 || ((x - 24) / 12) ** 2 + ((z - 31) / 9) ** 2 <= 1.02;
if (inside) set(x, 9, z, "#fff5e1");
const inner = z <= 31 || ((x - 24) / 10) ** 2 + ((z - 31) / 7) ** 2 <= 1;
if (x >= 14 && x <= 34 && z >= 28 && inner) {
set(x, 8, z, z >= 36 ? "#e44a42" : "#cb3035");
}
}
}
box(15, 8, 28, 33, 8, 28, "#a62430");
box(21, 7, 29, 27, 7, 30, "#d5d5cc");
box(22, 6, 29, 26, 6, 29, "#fff4d9");
set(24, 6, 30, "#777e79");
// Raised golden flag on the right side
box(37, 15, 30, 38, 18, 33, "#a9252d");
box(39, 16, 32, 40, 17, 43, "#edae28");
box(40, 16, 40, 41, 24, 44, "#f5bc2e");
box(41, 17, 41, 41, 23, 43, "#ffd448");
box(40, 16, 44, 41, 23, 44, "#ffe178");
box(40, 16, 32, 40, 17, 33, "#b87a21");
// Little flowers around the foot of the post
const flowers = [
[11, 13, "#fff9e7"], [35, 12, "#ff9db0"],
[12, 34, "#ff9db0"], [37, 31, "#fff9e7"],
[9, 26, "#fff9e7"], [32, 37, "#ff9db0"]
];
for (const [x, y, petal] of flowers) {
line(x, y, 1, x, y, 4, 0, "#458e35");
set(x - 1, y, 3, "#59ac3a");
set(x + 1, y, 4, petal);
set(x - 1, y, 4, petal);
set(x, y - 1, 4, petal);
set(x, y + 1, 4, petal);
set(x, y, 5, "#ffce40");
}import { draw } from "./assets/voxel";
import { buzonDeCampo } from "./assets/buzon-de-campo";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, buzonDeCampo, 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 buzon-de-campo
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["buzon-de-campo"] })
# Queda en client/assets/buzon-de-campo.ts
# https://fogon.page/object/buzon-de-campo