← Kit de nivelesObjeto 3Dfogon/nivel-bandera-de-meta
Bandera de meta
Arrastrá para girarlo// «Bandera de meta» · gpt-6-sol (medium)
// A goal flag for the end of a level: a square stone base (12x12, 4 tall) centered, a tall white-and-grey metal pole (2x2 blocks) rising from it to z 46 with a round gold ball on top, and a big flag 20 wide and 14 tall attached to the pole near the top, flying toward +x, with a black-and-white checkered pattern (4x4 squares) and 2 blocks thick. The flag cloth is a separate part hinged on the pole.
// Square stone plinth: 12 × 12 × 4.
for (let x = 18; x <= 29; x++) {
for (let y = 18; y <= 29; y++) {
for (let z = 0; z <= 3; z++) {
const color = z === 3 ? "#d9e0e3"
: z === 0 ? "#89959d"
: y === 18 ? "#b8c3c9"
: "#a5b0b8";
set(x, y, z, color);
}
}
}
// Two-by-two white-and-grey metal pole.
for (let z = 4; z <= 43; z++) {
for (let x = 23; x <= 24; x++) {
for (let y = 23; y <= 24; y++) {
set(x, y, z, y === 23
? (x === 23 ? "#ffffff" : "#e5ebee")
: (x === 23 ? "#c8d1d6" : "#aeb9c0"));
}
}
}
// Shiny gold finial, reaching z = 46.
sphere(23.5, 23.5, 44, 2.6, "#f5ae24");
for (let x = 21; x <= 26; x++) {
for (let y = 21; y <= 26; y++) {
for (let z = 42; z <= 46; z++) {
if (get(x, y, z) !== "#f5ae24") continue;
if (z >= 45) set(x, y, z, "#ffe36a");
else if (z === 42) set(x, y, z, "#cf811b");
}
}
}
set(22, 22, 44, "#fff2a0");
set(23, 22, 45, "#fff2a0");
// The two-block-thick flag hinges on the pole and extends toward +x.
part("bandera", [23.5, 23.5, 35]);
for (let x = 25; x <= 44; x++) {
for (let z = 28; z <= 41; z++) {
const white = (Math.floor((x - 25) / 4) + Math.floor((41 - z) / 4)) % 2 === 0;
set(x, 23, z, white ? "#ffffff" : "#262b35");
set(x, 24, z, white ? "#e4e9ec" : "#343a45");
}
}
animate("bandera", { type: "swing", axis: "z", speed: 2.2, amplitude: 0.35 });import { draw } from "./assets/voxel";
import { nivelBanderaDeMeta } from "./assets/nivel-bandera-de-meta";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelBanderaDeMeta, 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-bandera-de-meta
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-bandera-de-meta"] })
# Queda en client/assets/nivel-bandera-de-meta.ts
# https://fogon.page/object/nivel-bandera-de-meta