← Level pieces 23D assetfogon/nivel-reloj
Reloj de tiempo
Drag to turn it// «Reloj de tiempo» · gpt-6-sol (medium)
// A time power-up: a round alarm clock standing upright facing -y, radius 15, 8 thick, bright blue body with a white face, black hour marks, two black hands, two gold bells on top and two short gold feet; floating slightly.
part("reloj", [24, 24, 18]);
const cx = 24, cz = 19;
// Two short gold feet; the round body sits slightly above the floor.
for (const x of [15, 33]) {
box(x - 2, 20, 0, x + 2, 27, 1, "#c98716");
box(x - 2, 20, 2, x + 2, 27, 4, "#f4b92f");
box(x - 1, 19, 1, x + 1, 20, 3, "#ffd962");
}
// Solid, eight-block-thick blue clock body.
for (let x = 9; x <= 39; x++) {
for (let z = 4; z <= 34; z++) {
const d = Math.hypot(x - cx, z - cz);
if (d > 15) continue;
for (let y = 20; y <= 27; y++) {
const color = z < 13 ? "#0879ba"
: z > 26 ? "#39c6f2"
: y === 20 ? "#18a9e6"
: "#1599d8";
set(x, y, z, color);
}
// Raised blue bezel and clean white dial, both facing -y.
set(x, 19, z, d > 13 ? "#087fbd" : "#3dc9f2");
if (d <= 12.5) {
set(x, 18, z, d > 11.7 ? "#d4edf4" : "#ffffff");
}
}
}
// Twelve bold hour marks on the front of the dial.
for (let h = 0; h < 12; h++) {
const a = h * Math.PI / 6;
const cardinal = h % 3 === 0;
const inner = cardinal ? 9.5 : 10.5;
line(
cx + Math.sin(a) * inner, 17, cz + Math.cos(a) * inner,
cx + Math.sin(a) * 11.5, 17, cz + Math.cos(a) * 11.5,
cardinal ? 0.8 : 0.45, "#172d3b"
);
}
// Chunky hands at a cheerful, instantly readable ten-past-ten.
line(24, 16, 19, 20, 16, 24, 0.85, "#172d3b");
line(24, 16, 19, 29, 16, 27, 0.7, "#172d3b");
sphere(24, 15, 19, 1.2, "#172d3b");
set(24, 14, 19, "#ffd34c");
// Twin shiny alarm bells and their little connecting stems.
for (const x of [14, 34]) {
box(x - 1, 22, 32, x + 1, 25, 36, "#bd8019");
ellipsoid(x, 24, 37, 4.5, 4, 4, "#e8a925");
ellipsoid(x, 23, 39, 3.3, 2.5, 2.2, "#ffda61");
box(x - 4, 20, 35, x + 4, 27, 35, "#be7c15");
box(x - 3, 19, 36, x + 3, 20, 37, "#ffd15a");
box(x - 1, 23, 41, x + 1, 25, 42, "#ffe37b");
}
animate("reloj", { type: "swing", axis: "y", amplitude: 0.25, speed: 6 });import { draw } from "./assets/voxel";
import { nivelReloj } from "./assets/nivel-reloj";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelReloj, 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 nivel-reloj
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-reloj"] })
# It lands in client/assets/nivel-reloj.ts
# https://fogon.page/object/nivel-reloj