← Nature3D assetfogon/tulipanes
Tulipanes
Drag to turn it// «Tulipanes» · gpt-6-sol (medium)
// A row of five tulips in red, yellow and pink on straight green stems with long leaves, growing from a small patch of dark soil.
// A little oval patch of rich soil.
ellipsoid(23, 24, 1, 21, 9, 2.4, "#493021");
forEach((x, y, z, color) => {
if (color === "#493021" && !get(x, y, z + 1)) {
set(x, y, z, rand() < 0.22 ? "#62402a" : "#533625");
}
});
// Small flecks of grass around the flowers.
for (let i = 0; i < 95; i++) {
const x = 4 + Math.floor(rand() * 39);
const y = 17 + Math.floor(rand() * 15);
if (get(x, y, 2) && !get(x, y, 3)) {
set(x, y, 3, rand() < 0.5 ? "#65ad39" : "#81c746");
}
}
const flowers = [
{ x: 7, y: 24, base: 29, shades: ["#ad2840", "#e94250", "#ff7071"], center: "#6b2631" },
{ x: 15, y: 22, base: 32, shades: ["#c98521", "#f5b93a", "#ffe56a"], center: "#a35b22" },
{ x: 23, y: 25, base: 30, shades: ["#ba4981", "#ed78aa", "#ffabd0"], center: "#8c365f" },
{ x: 31, y: 23, base: 33, shades: ["#ad283c", "#ed4753", "#ff7772"], center: "#722632" },
{ x: 39, y: 24, base: 30, shades: ["#c88d25", "#f8c344", "#ffe877"], center: "#9c6726" }
];
function leaf(f, side, start, end, towardFront) {
for (let z = start; z <= end; z++) {
const t = (z - start) / (end - start);
const cx = Math.round(f.x + side * (0.5 + 6.5 * t));
const cy = Math.round(f.y + towardFront * (1 + 2 * t));
const width = Math.max(0, Math.round(2.1 * Math.sin(Math.PI * t)));
for (let w = -width; w <= width; w++) {
set(cx + w, cy, z, w === -side ? "#81d44b" : "#3c992e");
if (width > 0 && Math.abs(w) < width) {
set(cx + w, cy + 1, z, "#36922c");
}
}
set(cx, cy, z, "#a1df5a");
}
}
for (const f of flowers) {
// Straight, sturdy stems with a sunlit edge.
for (let z = 3; z <= f.base; z++) {
set(f.x, f.y, z, "#58ac32");
set(f.x + 1, f.y, z, "#3e902b");
set(f.x, f.y + 1, z, "#337d29");
set(f.x + 1, f.y + 1, z, "#438f2b");
}
leaf(f, -1, 5, 21, -1);
leaf(f, 1, 8, 24, 1);
// Solid, gently widening tulip cup.
const radii = [1, 1.7, 2.3, 2.8, 3, 3, 2.8];
for (let h = 0; h < radii.length; h++) {
for (let dx = -3; dx <= 3; dx++) {
for (let dy = -3; dy <= 3; dy++) {
if (dx * dx + dy * dy <= radii[h] * radii[h]) {
const shade = h < 2 || dy > 1 ? 0 : h >= 5 || dy < -1 ? 2 : 1;
set(f.x + dx, f.y + dy, f.base + h, f.shades[shade]);
}
}
}
}
// Five rounded petal tips leave a little dark opening visible above.
ellipsoid(f.x - 2, f.y, f.base + 6.7, 1.5, 1.5, 2.7, f.shades[1]);
ellipsoid(f.x + 2, f.y, f.base + 6.7, 1.5, 1.5, 2.7, f.shades[2]);
ellipsoid(f.x, f.y + 2, f.base + 7.2, 1.7, 1.5, 2.7, f.shades[2]);
ellipsoid(f.x - 1, f.y - 2, f.base + 6.2, 1.5, 1.3, 2.6, f.shades[1]);
ellipsoid(f.x + 1, f.y - 2, f.base + 6.2, 1.5, 1.3, 2.6, f.shades[2]);
set(f.x, f.y, f.base + 7, f.center);
set(f.x, f.y + 1, f.base + 7, f.center);
set(f.x, f.y, f.base + 8, "#ffe68a");
}import { draw } from "./assets/voxel";
import { tulipanes } from "./assets/tulipanes";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, tulipanes, 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 tulipanes
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["tulipanes"] })
# It lands in client/assets/tulipanes.ts
# https://fogon.page/object/tulipanes