← Piezas de nivel 2Objeto 3Dfogon/nivel-checkpoint
Checkpoint
Arrastrá para girarlo// «Checkpoint» · gpt-6-sol (medium)
// A checkpoint post: a round stone base radius 10, 4 tall, a thin white pole 34 tall, and on top a glowing orb (radius 5); a blue triangular pennant flag on the pole near the top; around the base a ring of small lights on the floor.
// Round stone checkpoint base, four blocks tall.
for (let z = 0; z <= 3; z++) {
for (let x = 14; x <= 34; x++) {
for (let y = 14; y <= 34; y++) {
const d2 = (x - 24) ** 2 + (y - 24) ** 2;
if (d2 > 100) continue;
let color = z === 0 ? "#8999a3" : "#b9c9d1";
if (d2 >= 81) color = z === 3 ? "#e0ebee" : "#9eafb9";
else if (z === 3) color = "#d2dfe3";
if (d2 < 81 && z === 3 && rand() < 0.035) color = "#e5eff0";
set(x, y, z, color);
}
}
}
// A thin, bright pole with a neat socket at its foot.
cylinder(24, 24, 4, 2, 2, "#718996");
cylinder(24, 24, 6, 1, 32, "#f5ffff");
line(23, 23, 6, 23, 23, 37, 0, "#d5e8ec");
cylinder(24, 24, 34, 2, 2, "#ffd867");
// Twelve small floor lights in a ring around the base.
for (let i = 0; i < 12; i++) {
const a = i * Math.PI / 6;
const x = Math.round(24 + 14 * Math.cos(a));
const y = Math.round(24 + 14 * Math.sin(a));
box(x - 1, y - 1, 0, x + 1, y + 1, 0, "#a3b7bd");
set(x, y, 0, "#ffe28a");
set(x, y, 1, "#fff4ad");
set(x, y, 2, "#fffbdc");
}
// The pennant hinges at the top of the pole.
part("bandera", [24, 24, 34]);
for (let x = 26; x <= 40; x++) {
const t = (x - 26) / 14;
const bottom = Math.ceil(27 + 4 * t);
const top = Math.floor(34 - 3 * t);
for (let z = bottom; z <= top; z++) {
for (let y = 22; y <= 23; y++) {
let color = y === 22 ? "#278ff0" : "#176bc5";
if (z === top) color = "#70d6ff";
if (z === bottom) color = "#1254ae";
set(x, y, z, color);
}
}
}
// A tiny white emblem, readable on the front of the flag.
set(30, 22, 31, "#ffffff");
set(31, 22, 30, "#ffffff");
set(31, 22, 31, "#ffffff");
set(31, 22, 32, "#ffffff");
set(32, 22, 31, "#ffffff");
animate("bandera", { type: "swing", axis: "z", amplitude: 0.3, speed: 3 });
// Gold setting beneath the glowing orb.
part("body");
cylinder(24, 24, 36, 3, 2, "#edac37");
cylinder(24, 24, 38, 3, 1, "#ffdc65");
// Glowing orb: top at z=45, safely inside the grid.
part("orbe", [24, 24, 40]);
sphere(24, 24, 40, 5, "#40ff90");
sphere(23, 22, 42, 2, "#a0ffd0");
animate("orbe", {
type: "colors",
palette: ["#40ff90", "#a0ffd0"],
pattern: "pulse",
glow: 0.8
});import { draw } from "./assets/voxel";
import { nivelCheckpoint } from "./assets/nivel-checkpoint";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelCheckpoint, 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-checkpoint
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-checkpoint"] })
# Queda en client/assets/nivel-checkpoint.ts
# https://fogon.page/object/nivel-checkpoint