← Kit de nivelesObjeto 3Dfogon/nivel-llave
Llave
Arrastrá para girarlo// «Llave» · gpt-6-sol (medium)
// A big golden key collectible standing upright, facing -y, about 30 tall, 4 blocks thick on y, centered at x 24: at the top a round bow (ring of outer radius 8 with a round hole of radius 4) at about z 22, a straight shaft going down from it to the bottom, and two rectangular teeth (bit) sticking out to the right near the bottom; it stands on a tiny round dark stone base (radius 6, 2 blocks tall) at z 0..1. Bright gold in 3 shades with a white highlight on the ring.
// Small, round stone plinth.
for (let z = 0; z <= 1; z++) {
for (let x = 18; x <= 30; x++) {
for (let y = 18; y <= 30; y++) {
if ((x - 24) ** 2 + (y - 24) ** 2 <= 36) {
set(x, y, z, z === 1 ? "#626b79" : "#353b49");
}
}
}
}
// Gold block shading: bright front and top, darker right edge and back.
function gold(x, y, z, top = false) {
let color = "#ffc72e";
if (y === 25 || x === 25) color = "#d99219";
if (y === 22 || top) color = "#ffe36a";
return color;
}
// Straight shaft, sunk into the base and joined to the bow.
for (let z = 2; z <= 17; z++) {
for (let x = 22; x <= 25; x++) {
for (let y = 22; y <= 25; y++) {
set(x, y, z, gold(x, y, z));
}
}
}
// Two crisp rectangular teeth on the right.
for (const [xEnd, z0, z1] of [[33, 4, 7], [31, 10, 12]]) {
for (let x = 26; x <= xEnd; x++) {
for (let y = 22; y <= 25; y++) {
for (let z = z0; z <= z1; z++) {
set(x, y, z, gold(x, y, z, z === z1));
}
}
}
}
// Upright circular bow: radius 8 outside, radius 4 open inside.
for (let x = 16; x <= 32; x++) {
for (let z = 14; z <= 30; z++) {
const d2 = (x - 24) ** 2 + (z - 22) ** 2;
if (d2 > 64 || d2 <= 16) continue;
for (let y = 22; y <= 25; y++) {
let color = "#ffc72e";
if (y === 25 || (x >= 29 && z < 23)) color = "#d99219";
if (y === 22 || z >= 27) color = "#ffe36a";
if (d2 <= 24 && y >= 23) color = "#e9a822";
set(x, y, z, color);
}
}
}
// Clean white glint following the upper-left curve of the front face.
for (const [x, z] of [
[18, 25], [19, 27], [20, 28], [21, 29], [22, 29]
]) {
set(x, 22, z, "#fff9d9");
}import { draw } from "./assets/voxel";
import { nivelLlave } from "./assets/nivel-llave";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelLlave, 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 nivel-llave
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-llave"] })
# Queda en client/assets/nivel-llave.ts
# https://fogon.page/object/nivel-llave