← Farm3D assetfogon/gallina
Gallina
Drag to turn it// «Gallina» · gpt-6-sol (medium)
// A plump cartoon hen: an egg-shaped white body with the tail feathers raised up at the back, a round head facing front (-y) with a bright red comb on top and a red wattle under a short yellow-orange beak, black dot eyes, small folded wings on the sides, and two thin orange legs with three-toed feet.
// Plump egg-shaped body, with a softly shaded white coat.
ellipsoid(24, 25, 18, 12, 12, 14, "#eeeae0");
ellipsoid(24, 25, 23, 10, 10, 11, "#eeeae0");
forEach((x, y, z) => {
let color = z < 11 ? "#dad9d1" : z < 19 ? "#eeece3" : "#fffdf4";
if (rand() < 0.055) color = z < 19 ? "#e5e2d9" : "#f4f1e9";
set(x, y, z, color);
});
// Raised tail feathers at the back.
ellipsoid(24, 36, 28, 7, 6, 5, "#e5e4dc");
for (const [x, tipY, tipZ] of [
[19, 40, 37], [22, 42, 40], [25, 43, 41],
[28, 41, 39], [31, 39, 36]
]) {
line(x, 34, 27, x, tipY, tipZ, 2, "#f5f3ea");
sphere(x, tipY, tipZ, 2, "#fffdf4");
}
line(22, 37, 29, 22, 41, 38, 0, "#e2dfd6");
line(28, 37, 29, 28, 40, 36, 0, "#e2dfd6");
// Small folded wings, one on each side.
for (const side of [-1, 1]) {
const wx = 24 + side * 11;
ellipsoid(wx, 24, 19, 3, 8, 6, "#dcdcd4");
ellipsoid(wx + side, 23, 21, 2, 7, 5, "#fffdf3");
for (let i = 0; i < 3; i++) {
line(wx + side * 2, 22 + i * 2, 17 - i,
wx + side, 26 + i * 2, 16 - i, 0, "#e8e5dc");
}
}
// Each orange leg pivots independently at the hip.
for (const [name, x, speed] of [
["left-leg", 19, 5], ["right-leg", 29, -5]
]) {
part(name, [x, 24, 8]);
line(x, 24, 8, x, 24, 1, 1, "#ef8b24");
box(x - 1, 23, 0, x + 1, 26, 1, "#ee861f");
line(x, 25, 0, x, 28, 0, 0, "#db741d");
for (const dx of [-2, 0, 2]) {
line(x, 23, 0, x + dx, 17, 0, 1, "#f39827");
set(x + dx, 16, 0, "#f39827");
}
animate(name, { type: "swing", axis: "x", speed, amplitude: 0.3 });
}
part("body");
// Big round head and its face move together when the hen pecks.
part("head", [24, 19, 27]);
ellipsoid(24, 15, 33, 8, 8, 8, "#f1eee6");
ellipsoid(24, 14, 34, 7, 7, 7, "#fffdf4");
// Red comb: three rounded points rising from a broad base.
box(20, 13, 40, 28, 18, 42, "#dc3431");
for (const [x, z, r] of [[21, 43, 2], [24, 45, 2], [27, 43, 2]]) {
sphere(x, 15, z, r, "#f0433a");
set(x, 14, z + 1, "#fa6250");
}
// Two simple, widely spaced dot eyes.
for (const x of [20, 28]) {
sphere(x, 7, 35, 1, "#242523");
set(x, 6, 36, "#ffffff");
}
// Pair of red wattles hanging beneath the short beak.
sphere(22, 7, 28, 2, "#df3534");
sphere(26, 7, 28, 2, "#df3534");
set(22, 6, 27, "#f34a40");
set(26, 6, 27, "#f34a40");
// Chunky yellow-orange beak points toward the viewer (-y).
box(22, 5, 30, 26, 8, 32, "#ed971f");
box(22, 5, 32, 26, 7, 33, "#ffc13d");
box(23, 3, 30, 25, 5, 32, "#f5a323");
box(23, 3, 32, 25, 5, 32, "#ffd04e");
animate("head", { type: "swing", axis: "x", speed: 4, amplitude: 0.35 });
part("body");import { draw } from "./assets/voxel";
import { gallina } from "./assets/gallina";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, gallina, 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 gallina
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["gallina"] })
# It lands in client/assets/gallina.ts
# https://fogon.page/object/gallina