← EquipamientoObjeto 3Dfogon/pocion-roja
Poción roja
Arrastrá para girarlo// «Poción roja» · gpt-6-sol (medium)
// A round-bottom glass potion flask standing on the floor: a big round bulb with a long neck and a cork, filled with glowing red liquid, light glass edges and a small white highlight, a little paper label tied with string.
// Round-bottom potion flask, centered on (24, 24).
const cx = 24, cy = 24, cz = 16;
const glass = "#8bcbd0";
// Glass bulb: cool, shaded edges and a clear front window for the potion.
shell(cx, cy, cz, 16, 2, glass);
forEach((x, y, z, color) => {
if (color !== glass) return;
const dx = x - cx, dz = z - cz;
if (y < cy && z <= 21 && dx * dx + dz * dz < 13.3 * 13.3) {
set(x, y, z, null);
} else {
set(x, y, z,
z > 23 ? "#b9e4df" :
z < 9 ? "#537f8c" :
rand() < 0.13 ? "#b7e4e3" : glass
);
}
});
// A modest flat contact patch keeps the round bulb standing.
ellipsoid(cx, cy, 1, 7, 7, 1, "#628f9a");
box(20, 19, 0, 28, 29, 0, "#527b87");
// The liquid is a separate, softly pulsing part.
part("liquid", [cx, cy, 16]);
for (let z = 2; z <= 20; z++) {
for (let y = 10; y <= 38; y++) {
for (let x = 10; x <= 38; x++) {
const dx = x - cx, dy = y - cy, dz = z - cz;
if (dx * dx + dy * dy + dz * dz > 14.4 * 14.4) continue;
const color = z === 20 ? "#f45151" :
y < 17 ? (rand() < 0.18 ? "#ef3944" : "#cf2536") :
z < 8 ? "#861a32" :
rand() < 0.12 ? "#db3541" : "#ac2035";
set(x, y, z, color);
}
}
}
animate("liquid", {
type: "colors",
palette: ["#931b32", "#bf2538", "#e43c46", "#fa5960"],
pattern: "pulse",
glow: 0.6
});
part("body");
// Thick glass rim around the visible liquid.
for (let z = 4; z <= 27; z++) {
for (let x = 9; x <= 39; x++) {
const d = (x - cx) ** 2 + (z - cz) ** 2;
if (d < 13.1 ** 2 || d > 16.1 ** 2) continue;
const y = Math.round(cy - Math.sqrt(Math.max(0, 16 ** 2 - d)));
set(x, y, z, z > 20 ? "#bce9e5" : "#78bbc5");
}
}
// Tall hollow-looking neck, heavy pouring lip, and fitted wooden cork.
cylinder(cx, cy, 29, 5, 11, "#86bac1");
cylinder(cx, cy, 31, 3, 9, "#527f8a");
box(19, 19, 30, 20, 20, 38, "#c1e7e3");
cylinder(cx, cy, 38, 7, 3, "#a5d9d8");
cylinder(cx, cy, 39, 5, 2, "#618f99");
box(18, 17, 39, 30, 18, 40, "#d6f3eb");
cylinder(cx, cy, 40, 4, 6, "#8c5534");
cylinder(cx, cy, 44, 4, 2, "#bb8050");
box(21, 20, 41, 21, 20, 44, "#c78d58");
box(26, 20, 41, 26, 20, 43, "#68402e");
// String follows the shoulders of the bulb and holds a paper tag.
for (let x = 13; x <= 35; x++) {
const dx = x - cx, dz = 23 - cz;
const y = Math.round(cy - Math.sqrt(Math.max(0, 16 ** 2 - dx * dx - dz * dz))) - 1;
box(x, y, 23, x, y + 1, 24, "#a57642");
}
box(16, 7, 15, 31, 9, 23, "#8e633f");
box(17, 6, 16, 30, 7, 22, "#e9d7a8");
box(18, 5, 17, 29, 5, 21, "#fff0c9");
box(17, 5, 22, 30, 7, 23, "#bd8b4b");
// Simple ruby seal, legible on the little label.
box(22, 4, 18, 25, 4, 20, "#aa2b38");
box(23, 3, 19, 24, 3, 20, "#ed5760");
// White glints on the curved glass, plus a few tiny liquid bubbles.
box(12, 12, 14, 13, 13, 21, "#efffff");
box(14, 10, 23, 15, 11, 26, "#e4ffff");
box(34, 13, 8, 35, 14, 11, "#c5eff0");
box(16, 9, 9, 17, 10, 10, "#ffd0c9");
box(31, 10, 13, 31, 11, 14, "#ffb9b5");import { draw } from "./assets/voxel";
import { pocionRoja } from "./assets/pocion-roja";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, pocionRoja, 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 pocion-roja
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["pocion-roja"] })
# Queda en client/assets/pocion-roja.ts
# https://fogon.page/object/pocion-roja