← EquipamientoObjeto 3Dfogon/bolsa-de-cuero
Bolsa de cuero
Arrastrá para girarlo// «Bolsa de cuero» · gpt-6-sol (medium)
// A small round leather pouch tied with a cord at the top, brown with darker stitching, sitting on the floor with a few gold coins spilling out in front of it.
const leather = ["#704020", "#7d4925", "#89512a", "#955b30"];
const shadow = "#4a291a";
const thread = "#3d2519";
const cord = "#c39755";
// Plump, floor-standing leather pouch.
ellipsoid(24, 26, 14, 15, 12, 14, leather[1]);
// Subtle variation and brighter upper-facing leather.
forEach((x, y, z, color) => {
if (color !== leather[1]) return;
const exposed = !get(x, y - 1, z) || !get(x, y, z + 1);
if (!exposed) return;
if (!get(x, y, z + 1) && rand() < 0.58) {
set(x, y, z, leather[3]);
} else if (rand() < 0.16) {
set(x, y, z, leather[2]);
} else if (z < 7 && rand() < 0.32) {
set(x, y, z, leather[0]);
}
});
// Broad gathered neck and slightly flared mouth.
ellipsoid(24, 26, 27, 8, 7, 7, leather[0]);
ellipsoid(24, 26, 32, 9, 7, 3, leather[2]);
ellipsoid(24, 26, 34, 7, 5, 2, leather[3]);
ellipsoid(24, 26, 35, 5, 3, 1, shadow);
// Short creases in the gathered leather.
for (const x of [19, 22, 26, 29]) {
line(x, 19, 30, x + (x < 24 ? 1 : -1), 19, 33, 0, leather[0]);
}
// A curved stitched seam across the pouch's front.
for (let i = 0; i <= 38; i++) {
const a = Math.PI * 0.12 + i * Math.PI * 0.76 / 38;
const x = Math.round(24 + 11 * Math.cos(a));
const z = Math.round(15 - 9 * Math.sin(a));
const q = 1 - ((x - 24) / 15) ** 2 - ((z - 14) / 14) ** 2;
if (q <= 0) continue;
const y = Math.floor(26 - 12 * Math.sqrt(q)) - 1;
set(x, y, z, i % 3 === 0 ? "#b17c47" : thread);
if (i % 4 === 0) set(x, y - 1, z + 1, thread);
}
// Thick cord cinched around the neck, with a front knot and loose ends.
for (let i = 0; i < 64; i++) {
const a = i * Math.PI * 2 / 64;
const x = Math.round(24 + 8 * Math.cos(a));
const y = Math.round(26 + 7 * Math.sin(a));
sphere(x, y, 28, 1.2, i % 7 === 0 ? "#e0b979" : cord);
}
sphere(24, 18, 28, 2.6, "#ab7941");
sphere(24, 16, 29, 1.5, "#dfb36a");
line(23, 17, 27, 17, 14, 19, 1.3, cord);
line(17, 14, 19, 16, 15, 17, 1.3, "#a6753c");
line(25, 17, 27, 31, 13, 21, 1.3, cord);
line(31, 13, 21, 33, 14, 18, 1.3, "#a6753c");
// Chunky gold coins scattered in front, each with a raised rim and glint.
function coin(x, y, r) {
cylinder(x, y, 0, r, 2, "#a66b20");
cylinder(x, y, 1, r - 0.5, 2, "#e2ab36");
cylinder(x, y, 2, r - 1.4, 1, "#f6ca58");
line(x - 1, y - 1, 3, x + 1, y - 1, 3, 0, "#ffe08a");
}
coin(17, 10, 4);
coin(25, 8, 4);
coin(32, 12, 3.5);
coin(21, 14, 3.5);
coin(12, 7, 3);import { draw } from "./assets/voxel";
import { bolsaDeCuero } from "./assets/bolsa-de-cuero";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, bolsaDeCuero, 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 bolsa-de-cuero
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["bolsa-de-cuero"] })
# Queda en client/assets/bolsa-de-cuero.ts
# https://fogon.page/object/bolsa-de-cuero