← Level pieces 23D assetfogon/nivel-bloque-pregunta
Bloque sorpresa
Drag to turn it// «Bloque sorpresa» · gpt-6-sol (medium)
// A floating question block: a cube 32x32x32 with its bottom at z 8, bright yellow-orange with darker corner rivets and a light top edge, a big white question mark on all four sides.
part("bloque", [24, 24, 24]);
// Solid 32 × 32 × 32 block, with its bottom at z = 0.
box(8, 8, 0, 39, 39, 31, "#eda51b");
// Draw the same detail on all four vertical faces.
function face(u, z, color) {
set(u, 8, z, color);
set(39 - (u - 8), 39, z, color);
set(8, 39 - (u - 8), z, color);
set(39, u, z, color);
}
// Crisp frame and bright inset panels.
for (let u = 8; u <= 39; u++) {
for (let z = 0; z <= 31; z++) {
let color = "#e99b17";
if (u >= 10 && u <= 37 && z >= 2 && z <= 29) color = "#ffc12d";
if (z >= 30) color = "#ffdc59";
else if (z <= 1) color = "#c97c12";
else if (u === 9 || u === 38) color = "#ffd047";
face(u, z, color);
}
}
// Light top edge and golden top.
box(8, 8, 31, 39, 39, 31, "#ffe078");
box(10, 10, 31, 37, 37, 31, "#ffd153");
// Chunky corner rivets on every side.
for (const u of [11, 35]) {
for (const z of [4, 27]) {
for (let du = -1; du <= 1; du++) {
for (let dz = -1; dz <= 1; dz++) {
face(u + du, z + dz, "#a86210");
}
}
face(u, z, "#e9a12b");
}
}
const mark = [
".....##########.....",
"...##############...",
"..#####......#####..",
".#####........#####.",
".####..........####.",
"...............####.",
"..............#####.",
"............######..",
"..........######....",
"........######......",
".......#####........",
".......#####........",
".......#####........",
".......#####........",
"....................",
"....................",
".......#####........",
".......#####........",
".......#####........",
".......#####........"
];
// Amber offset shadow, then white question marks on all four sides.
for (let row = 0; row < mark.length; row++) {
for (let col = 0; col < mark[row].length; col++) {
if (mark[row][col] === "#") face(15 + col, 25 - row, "#d88b16");
}
}
for (let row = 0; row < mark.length; row++) {
for (let col = 0; col < mark[row].length; col++) {
if (mark[row][col] === "#") face(14 + col, 26 - row, "#fffdf0");
}
}
animate("bloque", { type: "bob", axis: "z", speed: 2, amplitude: 1 });import { draw } from "./assets/voxel";
import { nivelBloquePregunta } from "./assets/nivel-bloque-pregunta";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelBloquePregunta, 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-bloque-pregunta
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-bloque-pregunta"] })
# It lands in client/assets/nivel-bloque-pregunta.ts
# https://fogon.page/object/nivel-bloque-pregunta