← Level pieces 23D assetfogon/nivel-interruptor
Bloque interruptor
Drag to turn it// «Bloque interruptor» · gpt-6-sol (medium)
// A switch block: a cube 32x32x32 centered on the floor, bright blue with a lighter top and darker bottom edges, with a big white exclamation mark on all four sides and a small raised rim around each face.
// 32 × 32 × 32 switch block, from z = 0 to z = 31.
const blue = "#168cf0";
const panel = "#249dff";
const rimLight = "#55bdff";
const rimDark = "#0870d3";
const bottom = "#0759b5";
box(9, 9, 0, 38, 38, 30, blue);
box(9, 9, 0, 38, 38, 2, bottom);
// Recessed blue panels leave room for the raised face rims.
box(11, 9, 3, 36, 9, 28, panel);
box(11, 38, 3, 36, 38, 28, blue);
box(9, 11, 3, 9, 36, 28, panel);
box(38, 11, 3, 38, 36, 28, blue);
// Each rim sits one block proud of its panel.
for (const y of [8, 39]) {
const edge = y === 8 ? rimLight : rimDark;
box(8, y, 0, 39, y, 2, bottom);
box(8, y, 29, 39, y, 30, edge);
box(8, y, 3, 10, y, 28, edge);
box(37, y, 3, 39, y, 28, rimDark);
}
for (const x of [8, 39]) {
const edge = x === 8 ? rimLight : rimDark;
box(x, 8, 0, x, 39, 2, bottom);
box(x, 8, 29, x, 39, 30, edge);
box(x, 8, 3, x, 10, 28, edge);
box(x, 37, 3, x, 39, 28, rimDark);
}
// Bright, flat top with a subtle glossy edge.
box(8, 8, 31, 39, 39, 31, "#67caff");
box(9, 9, 31, 38, 38, 31, "#4db9ff");
box(10, 10, 31, 35, 11, 31, "#8ad8ff");
box(10, 12, 31, 11, 34, 31, "#8ad8ff");
// The four white marks form one color-cycling part.
part("marca", [24, 24, 16]);
for (const y of [8, 39]) {
box(21, y, 14, 26, y, 25, "#ffffff");
box(22, y, 11, 25, y, 13, "#ffffff");
box(22, y, 5, 25, y, 8, "#ffffff");
}
for (const x of [8, 39]) {
box(x, 21, 14, x, 26, 25, "#ffffff");
box(x, 22, 11, x, 25, 13, "#ffffff");
box(x, 22, 5, x, 25, 8, "#ffffff");
}
animate("marca", {
type: "colors",
palette: ["#ffffff", "#a8d8ff"],
pattern: "pulse",
glow: 0.5
});import { draw } from "./assets/voxel";
import { nivelInterruptor } from "./assets/nivel-interruptor";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelInterruptor, 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-interruptor
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-interruptor"] })
# It lands in client/assets/nivel-interruptor.ts
# https://fogon.page/object/nivel-interruptor