← BásicoObjeto 3Dfogon/farol
Farol
Arrastrá para girarlo// «Farol» · gpt-6-sol (medium)
// Lantern («Farol»).
// Ornate brass-and-teal lantern, facing -y.
const navy = "#152e38";
const darkTeal = "#1b3d49";
const teal = "#285462";
const lightTeal = "#376777";
const brass = "#b77b32";
const gold = "#dea64b";
const brightGold = "#efbd62";
function rim(a, b, c, d, z, width, color) {
box(a, b, z, d, b + width - 1, z, color);
box(a, c - width + 1, z, d, c, z, color);
box(a, b, z, a + width - 1, c, z, color);
box(d - width + 1, b, z, d, c, z, color);
}
// Stepped square plinth.
box(11, 11, 0, 37, 37, 0, navy);
box(10, 10, 1, 38, 38, 2, darkTeal);
rim(10, 10, 38, 38, 2, 1, lightTeal);
box(9, 9, 3, 39, 39, 3, navy);
rim(9, 9, 39, 39, 3, 1, teal);
box(11, 11, 4, 37, 37, 4, brass);
rim(11, 11, 37, 37, 4, 1, brightGold);
box(12, 12, 5, 36, 36, 6, darkTeal);
rim(12, 12, 36, 36, 6, 1, gold);
// Warm, solid lantern chamber.
box(12, 12, 7, 36, 36, 27, "#966027");
box(13, 13, 8, 35, 35, 26, "#d39338");
// Front glass, divided into two tall panes.
for (const [x0, x1] of [[15, 22], [27, 34]]) {
box(x0, 9, 10, x1, 9, 25, "#bd792a");
box(x0 + 1, 9, 12, x1 - 1, 9, 23, "#e2a647");
box(x0 + 2, 9, 14, x0 + 3, 9, 21, "#f1c36a");
box(x1 - 1, 9, 12, x1 - 1, 9, 22, "#cc8933");
box(x0, 9, 10, x1, 9, 10, "#9c652b");
box(x0, 9, 25, x1, 9, 25, gold);
}
// Matching glass on the right side.
for (const [y0, y1] of [[15, 22], [27, 34]]) {
box(39, y0, 10, 39, y1, 25, "#ad702a");
box(39, y0 + 1, 12, 39, y1 - 1, 23, "#d99b3e");
box(39, y0 + 2, 14, 39, y0 + 3, 21, "#eab257");
box(39, y1 - 1, 12, 39, y1 - 1, 22, "#b97a2c");
}
// Solid corner posts and the narrow mullions between panes.
for (const x of [10, 35]) {
for (const y of [10, 35]) {
box(x, y, 7, x + 3, y + 3, 27, navy);
box(x + 1, y, 8, x + 2, y, 25, teal);
box(x + 3, y + 1, 8, x + 3, y + 2, 25, darkTeal);
}
}
box(23, 9, 8, 26, 11, 27, navy);
box(24, 9, 10, 24, 9, 25, teal);
box(37, 23, 8, 39, 26, 27, navy);
box(39, 24, 10, 39, 24, 25, teal);
// Brass beads and fittings on the frame.
for (const z of [8, 25]) {
box(14, 9, z, 34, 9, z, brass);
box(39, 14, z, 39, 34, z, brass);
}
for (const x of [11, 24, 36]) {
box(x, 8, 7, x + 1, 9, 9, gold);
box(x, 8, 24, x + 1, 9, 26, brass);
}
for (const y of [11, 24, 36]) {
box(39, y, 7, 40, y + 1, 9, gold);
box(39, y, 24, 40, y + 1, 26, brass);
}
rim(11, 11, 37, 37, 7, 1, gold);
// Warm gilded underside beneath the broad roof.
box(9, 9, 27, 39, 39, 27, "#865c2c");
rim(9, 9, 39, 39, 27, 2, gold);
box(7, 7, 28, 41, 41, 28, navy);
rim(7, 7, 41, 41, 28, 1, brass);
// Broad, shallow, tiered blue-green roof.
const tiers = [
[5, 43, 29], [6, 42, 30], [8, 40, 31],
[10, 38, 32], [12, 36, 33], [14, 34, 34],
[16, 32, 35]
];
for (const [lo, hi, z] of tiers) {
box(lo, lo, z, hi, hi, z, darkTeal);
rim(lo, lo, hi, hi, z, 1, navy);
box(lo + 2, lo + 1, z, hi - 2, lo + 1, z, teal);
box(hi - 1, lo + 2, z, hi - 1, hi - 2, z, "#214550");
if (z % 2 === 0) {
box(lo + 3, lo + 3, z, hi - 3, lo + 3, z, lightTeal);
box(lo + 3, lo + 3, z, lo + 3, hi - 3, z, teal);
}
}
// Heavy edge and projecting roof corners.
rim(5, 5, 43, 43, 29, 2, navy);
box(7, 5, 30, 41, 5, 30, lightTeal);
box(43, 7, 30, 43, 41, 30, teal);
for (const x of [7, 39]) {
for (const y of [7, 39]) {
box(x, y, 28, x + 2, y + 2, 30, darkTeal);
set(x + 1, y + 1, 31, teal);
}
}
// Small raised vent at the center of the roof.
box(18, 18, 35, 30, 30, 36, navy);
rim(18, 18, 30, 30, 36, 1, gold);
box(19, 19, 37, 29, 29, 38, darkTeal);
rim(19, 19, 29, 29, 38, 1, teal);
box(21, 21, 39, 27, 27, 39, navy);
set(24, 20, 39, gold);
// Arched carrying handle, set behind the vent.
const arch = [
[13, 35], [14, 38], [16, 40], [18, 42], [21, 44],
[24, 45], [27, 44], [30, 42], [32, 40], [34, 38], [35, 35]
];
for (let i = 0; i < arch.length - 1; i++) {
line(arch[i][0], 29, arch[i][1],
arch[i + 1][0], 29, arch[i + 1][1], 1, navy);
}
line(21, 28, 44, 27, 28, 44, 0, teal);
for (const x of [13, 35]) box(x - 1, 28, 34, x + 1, 30, 36, teal);
// Restrained handmade variation on exposed roof and glass.
forEach((x, y, z, color) => {
if (z >= 30 && z <= 34 && color === darkTeal && rand() < 0.035)
set(x, y, z, teal);
if (z >= 13 && z <= 22 && color === "#e2a647" && rand() < 0.035)
set(x, y, z, "#edb758");
});import { draw } from "./assets/voxel";
import { farol } from "./assets/farol";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, farol, 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 farol
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["farol"] })
# Queda en client/assets/farol.ts
# https://fogon.page/object/farol