← Medieval3D assetfogon/palanca-de-mazmorra
Palanca de mazmorra
Drag to turn it// «Palanca de mazmorra» · gpt-6-sol (medium)
// A dungeon wall lever: an upright dark stone block with an iron plate mounted on its front, a long black iron lever with a red round knob sticking out of a slot, a chain running up from it and a small skull carving above.
// Dungeon wall
const stone = ["#77756f", "#85837c", "#928f86", "#a5a197"];
const mortar = "#514f4b";
const iron = "#24272a";
const ironLight = "#555c5f";
const ironDark = "#111517";
// Solid core, with individually laid stones on the visible face.
box(10, 24, 0, 37, 34, 42, mortar);
for (let course = 0; course < 10; course++) {
const z = course * 4;
let x = course % 2 ? 8 : 11;
while (x <= 39) {
const width = 6 + Math.floor(rand() * 4);
const end = Math.min(39, x + width - 1);
const shade = stone[Math.floor(rand() * stone.length)];
box(x, 22, z, end, 24, Math.min(z + 2, 39), shade);
if (rand() < 0.3) {
box(x + 1, 21, z + 2, Math.min(end - 1, x + 3), 21, z + 2, "#6c7465");
}
x = end + 2;
}
}
// Heavy side piers, footing, and capstones.
box(8, 20, 0, 11, 36, 39, "#77746d");
box(36, 20, 0, 39, 36, 39, "#77746d");
box(8, 19, 0, 39, 36, 3, "#686660");
box(8, 19, 3, 39, 35, 3, "#a29d92");
box(8, 20, 39, 39, 35, 43, "#76736c");
box(8, 19, 40, 39, 35, 40, "#aaa59a");
box(8, 19, 43, 39, 35, 43, "#918d83");
for (const x of [9, 38]) {
box(x, 19, 5, x, 19, 38, "#aaa59a");
for (let z = 8; z < 39; z += 8) set(x, 18, z, "#555550");
}
// Moss tucked into a few low mortar joints.
for (let i = 0; i < 28; i++) {
const x = 12 + Math.floor(rand() * 25);
const z = 4 + Math.floor(rand() * 32);
if ((x < 16 || x > 32) && rand() < 0.65)
set(x, 21, z, rand() < 0.5 ? "#68765a" : "#52684e");
}
// Iron mounting plate: raised rim, worn face, and a deep lever slot.
box(17, 18, 11, 30, 21, 31, "#383c3e");
box(16, 16, 10, 31, 20, 12, iron);
box(16, 16, 30, 31, 20, 32, iron);
box(16, 16, 11, 18, 20, 31, iron);
box(29, 16, 11, 31, 20, 31, iron);
box(18, 16, 13, 29, 16, 29, "#44494b");
box(18, 15, 13, 29, 15, 13, ironLight);
box(18, 15, 29, 29, 15, 29, ironLight);
box(22, 14, 15, 26, 16, 28, "#090d0f");
box(21, 14, 15, 21, 14, 28, "#777b79");
box(27, 14, 15, 27, 14, 28, "#202426");
for (const x of [18, 29]) {
for (const z of [12, 20, 30]) {
sphere(x, 15, z, 1, "#828785");
set(x, 14, z, "#b5b7ab");
}
}
// Chain, rising beside the lever toward the skull carving.
line(27, 13, 23, 29, 13, 27, 1, ironDark);
for (let z = 27; z <= 36; z += 3) {
box(28, 14, z, 30, 14, z, ironLight);
box(28, 14, z + 2, 30, 14, z + 2, ironLight);
set(28, 14, z + 1, ironDark);
set(30, 14, z + 1, ironDark);
set(29, 13, z, "#89908b");
}
box(28, 14, 38, 30, 16, 39, iron);
set(29, 13, 38, "#868c87");
// Small, pale skull relief above the plate.
ellipsoid(24, 17, 37, 4, 2, 3, "#c7bd9f");
box(22, 15, 33, 26, 17, 36, "#b5aa8e");
box(21, 15, 37, 21, 16, 38, "#e0d5b3");
box(27, 15, 37, 27, 16, 38, "#e0d5b3");
box(21, 16, 39, 27, 16, 39, "#eee0bc");
box(22, 14, 36, 23, 14, 37, ironDark);
box(25, 14, 36, 26, 14, 37, ironDark);
set(24, 14, 35, ironDark);
for (const x of [22, 24, 26]) set(x, 14, 33, "#ece0bf");
// The entire handle swings from its socket.
part("lever", [24, 14, 20]);
sphere(24, 13, 20, 2, ironLight);
sphere(24, 12, 20, 1, "#8a8c85");
line(24, 12, 20, 24, 5, 27, 1.3, ironDark);
line(23, 11, 21, 23, 5, 27, 0, "#666967");
sphere(24, 5, 28, 3, "#8c2526");
sphere(24, 5, 29, 2, "#b73531");
set(23, 3, 30, "#e66a53");
animate("lever", { type: "swing", axis: "x", speed: 1.5, amplitude: 0.5 });import { draw } from "./assets/voxel";
import { palancaDeMazmorra } from "./assets/palanca-de-mazmorra";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, palancaDeMazmorra, 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 palanca-de-mazmorra
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["palanca-de-mazmorra"] })
# It lands in client/assets/palanca-de-mazmorra.ts
# https://fogon.page/object/palanca-de-mazmorra