← Farm3D assetfogon/comedero
Comedero
Drag to turn it// «Comedero» · gpt-6-sol (medium)
// A long wooden animal feed trough standing on two X-shaped wooden legs: a V-shaped open box of brown planks with darker metal bands at the ends, filled with golden grain and some green hay sticking up.
const wood = ["#8e542d", "#a96532", "#bd793b", "#ca8848"];
const straw = ["#d99b35", "#e7b548", "#f2c85d", "#ffda72"];
const green = ["#639b35", "#79b845", "#9dcc58"];
function frontY(z) { return 22 - Math.round((z - 13) * 0.8); }
function backY(z) { return 26 + Math.round((z - 13) * 0.8); }
// Two chunky X-shaped trestles beneath the trough.
for (const cx of [13, 35]) {
for (const y of [22, 24, 26]) {
line(cx - 5, y, 0, cx + 5, y, 13, 1, "#8e532d");
line(cx + 5, y, 0, cx - 5, y, 13, 1, "#a96635");
}
box(cx - 6, 21, 0, cx - 3, 27, 1, "#704225");
box(cx + 3, 21, 0, cx + 6, 27, 1, "#704225");
box(cx - 1, 19, 6, cx + 1, 20, 8, "#aab5b3");
set(cx, 18, 7, "#dce1d7");
}
box(7, 22, 11, 41, 26, 13, "#724525");
// Solid wooden bottom and sloping plank sides.
box(5, 21, 13, 43, 27, 15, "#86502d");
for (let z = 14; z <= 23; z++) {
const f = frontY(z), b = backY(z);
const shade = z < 17 ? wood[0] : z < 21 ? wood[1] : wood[2];
box(5, f, z, 43, f + 2, z, shade);
box(5, b - 2, z, 43, b, z, z > 20 ? wood[3] : wood[1]);
// End boards close off the V while leaving its top open.
box(5, f + 3, z, 6, b - 3, z, wood[Math.min(3, Math.floor((z - 13) / 3))]);
box(42, f + 3, z, 43, b - 3, z, wood[Math.min(3, Math.floor((z - 13) / 3))]);
}
// Crisp horizontal plank joins on the visible front.
for (const z of [17, 20]) {
box(8, frontY(z), z, 40, frontY(z), z, "#704126");
}
for (const x of [16, 28, 39]) {
for (let z = 15; z <= 22; z++)
set(x, frontY(z), z, "#8b5029");
}
// Grain fills the V, with a gently uneven golden surface.
for (let x = 8; x <= 40; x++) {
for (let y = 19; y <= 29; y++) {
const edge = Math.abs(y - 24);
const top = 21 - (edge >= 5 ? 2 : edge >= 4 ? 1 : 0)
+ (rand() < 0.12 ? 1 : 0);
for (let z = 15; z <= top; z++) {
if (y > frontY(z) + 2 && y < backY(z) - 2)
set(x, y, z, z === top
? straw[Math.floor(rand() * straw.length)]
: "#c88c32");
}
}
}
// Broad wooden lips make the open mouth legible.
box(5, 14, 23, 43, 16, 23, "#d29450");
box(5, 32, 23, 43, 34, 23, "#d29450");
box(7, 15, 24, 41, 15, 24, "#e1a660");
box(7, 33, 24, 41, 33, 24, "#e1a660");
// Dark galvanized bands wrap around both ends.
for (const x of [7, 40]) {
for (let z = 14; z <= 23; z++) {
const f = frontY(z), b = backY(z);
box(x, f - 1, z, x + 1, f + 2, z, "#515a58");
box(x, b - 2, z, x + 1, b + 1, z, "#596460");
}
box(x, 14, 24, x + 1, 16, 24, "#73807a");
box(x, 32, 24, x + 1, 34, 24, "#73807a");
for (const z of [17, 21]) {
set(x, frontY(z) - 1, z, "#b8c2b8");
set(x + 1, frontY(z) - 1, z, "#343d3b");
}
}
// Loose straw and fresh green hay poke out above the grain.
for (let i = 0; i < 95; i++) {
const x = 9 + Math.floor(rand() * 31);
const y = 20 + Math.floor(rand() * 9);
const z = 21 + Math.floor(rand() * 2);
if (rand() < 0.7)
set(x, y, z, straw[Math.floor(rand() * straw.length)]);
}
for (let i = 0; i < 42; i++) {
const x = 10 + Math.floor(rand() * 29);
const y = 21 + Math.floor(rand() * 7);
const height = 2 + Math.floor(rand() * 6);
const lean = Math.floor(rand() * 5) - 2;
const color = rand() < 0.55
? green[Math.floor(rand() * green.length)]
: straw[2 + Math.floor(rand() * 2)];
line(x, y, 21, x + lean, y - 1, 21 + height, 0, color);
set(x + lean, y - 1, 21 + height, rand() < 0.6 ? "#b9d765" : "#ffe084");
}import { draw } from "./assets/voxel";
import { comedero } from "./assets/comedero";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, comedero, 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 comedero
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["comedero"] })
# It lands in client/assets/comedero.ts
# https://fogon.page/object/comedero