← Farm3D assetfogon/fardo-de-heno
Fardo de heno
Drag to turn it// «Fardo de heno» · gpt-6-sol (medium)
// A rectangular hay bale lying on the ground: a chunky block of golden straw with streaky texture in several yellow and tan shades, loose straw strands sticking out at the ends, and two thin brown twine bands wrapped around it. A smaller loose pile of straw beside it.
// Chunky rectangular bale with a slightly uneven, straw-cut silhouette.
const gold = ["#e6a92e", "#edb735", "#f4c64b", "#f7d15a", "#d99b2b"];
const pale = ["#ffe078", "#f6cc52", "#eab342", "#d89b30"];
const darkStraw = ["#ca8d28", "#d9a137", "#e5ac38"];
for (let x = 6; x <= 39; x++) {
for (let y = 16; y <= 35; y++) {
for (let z = 2; z <= 20; z++) {
const nearYEdge = y <= 17 || y >= 34;
const nearZEdge = z <= 3 || z >= 19;
if (nearYEdge && nearZEdge && rand() < 0.48) continue;
if ((x === 6 || x === 39) && nearYEdge && rand() < 0.22) continue;
let color = z >= 16 ? "#f1c449" : z <= 5 ? "#dca330" : "#eab43a";
if (rand() < 0.27) color = gold[Math.floor(rand() * gold.length)];
set(x, y, z, color);
}
}
}
// Long, fine straw marks on the front face.
for (let i = 0; i < 310; i++) {
const x = 7 + Math.floor(rand() * 31);
const z = 3 + Math.floor(rand() * 17);
const len = 2 + Math.floor(rand() * 7);
const color = rand() < 0.7
? pale[Math.floor(rand() * pale.length)]
: darkStraw[Math.floor(rand() * darkStraw.length)];
line(x, 15, z, Math.min(39, x + len), 15, z + (rand() < 0.13 ? 1 : 0), 0, color);
}
// Sunlit streaks across the upper surface.
for (let i = 0; i < 155; i++) {
const x = 7 + Math.floor(rand() * 31);
const y = 17 + Math.floor(rand() * 18);
const len = 2 + Math.floor(rand() * 7);
line(x, y, 21, Math.min(39, x + len), y, 21, 0,
pale[Math.floor(rand() * pale.length)]);
}
// Cut straw visible on both ends.
for (const endX of [5, 40]) {
for (let y = 18; y <= 33; y++) {
for (let z = 4; z <= 18; z++) {
if (rand() < 0.47) {
set(endX, y, z, rand() < 0.6 ? "#f4c44b" : "#dba135");
}
}
}
for (let i = 0; i < 105; i++) {
const y = 18 + Math.floor(rand() * 16);
const z = 4 + Math.floor(rand() * 15);
set(endX, y, z, rand() < 0.6 ? "#ffe078" : "#b98629");
}
}
// Loose stalks poke beyond the bale's ends.
for (const side of [-1, 1]) {
for (let i = 0; i < 68; i++) {
const y = 17 + Math.floor(rand() * 18);
const z = 3 + Math.floor(rand() * 17);
const start = side < 0 ? 6 : 39;
const reach = 1 + Math.floor(rand() * 4);
line(start, y, z, start + side * reach, y + Math.floor(rand() * 3) - 1,
z + Math.floor(rand() * 3) - 1, 0,
pale[Math.floor(rand() * pale.length)]);
}
}
// Two snug brown twine loops, visible across the top and front.
for (const x0 of [14, 30]) {
for (let dx = 0; dx < 2; dx++) {
const x = x0 + dx;
const twine = dx === 0 ? "#815020" : "#ad712d";
for (let z = 3; z <= 20; z++) {
set(x, 14, z, twine);
set(x, 36, z, "#855324");
}
for (let y = 15; y <= 36; y++) {
set(x, y, 22, twine);
set(x, y, 1, "#75491f");
}
set(x, 14, 21, twine);
}
// Tiny highlight along the sunny top of each cord.
for (let y = 17; y <= 35; y++) set(x0 + 1, y, 22, "#c18a3c");
}
// A separate, low heap of spilled hay beside the bale.
for (let x = 30; x <= 44; x++) {
for (let y = 4; y <= 13; y++) {
const d = ((x - 37) / 7.5) ** 2 + ((y - 8.5) / 5.2) ** 2;
const height = Math.max(0, Math.floor(5.6 * (1 - d) + rand() * 1.7));
for (let z = 0; z <= height; z++) {
set(x, y, z, z >= height - 1
? pale[Math.floor(rand() * pale.length)]
: gold[Math.floor(rand() * gold.length)]);
}
}
}
for (let i = 0; i < 110; i++) {
const x = 29 + Math.floor(rand() * 16);
const y = 3 + Math.floor(rand() * 11);
const z = Math.floor(rand() * 5);
const len = 1 + Math.floor(rand() * 4);
line(x, y, z, Math.min(45, x + len), y + Math.floor(rand() * 3) - 1,
Math.max(0, z + Math.floor(rand() * 3) - 1), 0,
pale[Math.floor(rand() * pale.length)]);
}import { draw } from "./assets/voxel";
import { fardoDeHeno } from "./assets/fardo-de-heno";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, fardoDeHeno, 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 fardo-de-heno
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["fardo-de-heno"] })
# It lands in client/assets/fardo-de-heno.ts
# https://fogon.page/object/fardo-de-heno