← CiudadObjeto 3Dfogon/guard-booth
Garita de guardia
Arrastrá para girarlo// «Garita de guardia» · propio
// A small guard booth: white walls with a blue stripe, big windows on three sides, a door, a flat overhanging roof with a little lamp, and a red and white boom barrier beside it.
// A guard booth (the door on its left side, big windows on the other three) and, beside it, a boom barrier across the way.
const WALL = { base: "#eff0ed", light: "#fafaf8", shade: "#d9dbd8" };
const BLUE = { base: "#2f6fc0", light: "#4a88d8", dark: "#24579a" };
const GLASS = { base: "#8ecbe6", light: "#c6e7f5", dark: "#6fb3d2" };
const FRAME = "#3d4654", ROOF = "#465064", ROOF_TOP = "#5e6a82", ROOF_EDGE = "#353d4d";
const CONCRETE = { base: "#b1b0aa", dark: "#93928c" };
const X0 = 2, X1 = 20, Y0 = 13, Y1 = 32, TOP = 26;
// The plinth and the step at the door.
for (let x = 1; x <= 21; x++) for (let y = 12; y <= 33; y++) for (let z = 0; z <= 1; z++) set(x, y, z, z === 0 || rand() < 0.15 ? CONCRETE.dark : CONCRETE.base);
// The walls: white, a blue stripe, a darker skirting. Hollow inside.
for (let x = X0; x <= X1; x++)
for (let y = Y0; y <= Y1; y++)
for (let z = 2; z <= TOP; z++) {
if (x > X0 && x < X1 && y > Y0 && y < Y1) continue;
let c = rand() < 0.15 ? WALL.light : rand() < 0.03 ? WALL.shade : WALL.base;
if (z === 2) c = WALL.shade;
if (z >= 7 && z <= 9) c = z === 9 ? BLUE.light : BLUE.base;
if (z === TOP) c = WALL.shade;
set(x, y, z, c);
}
// A window on a wall: dark frame, a post in the middle, glass with a streak of light.
function windowOn(put, a0, a1) {
const mid = (a0 + a1) / 2;
for (let a = a0; a <= a1; a++)
for (let z = 12; z <= 22; z++) {
const border = a === a0 || a === a1 || z === 12 || z === 22 || a === mid;
put(a, z, border ? FRAME : (a + z) % 9 < 2 ? GLASS.light : z < 15 ? GLASS.dark : GLASS.base);
}
}
windowOn((a, z, c) => set(a, Y0, z, c), 5, 17); // front
windowOn((a, z, c) => set(a, Y1, z, c), 5, 17); // back
windowOn((a, z, c) => set(X1, a, z, c), 16, 28); // right, towards the barrier
for (let x = 4; x <= 18; x++) { set(x, Y0 - 1, 11, "#c5c8cc"); set(x, Y0 - 1, 10, "#a9adb2"); } // the sill, a counter
// The door, on the left: blue, glass in its upper half, a handle.
for (let y = 18; y <= 26; y++)
for (let z = 2; z <= 23; z++) {
const border = y === 18 || y === 26 || z === 23;
let c = border ? FRAME : BLUE.base;
if (!border && z >= 13 && z <= 21 && y >= 20 && y <= 24) c = (y + z) % 9 < 2 ? GLASS.light : GLASS.base;
if (!border && (z === 12 || z === 22) && y >= 20 && y <= 24) c = BLUE.dark;
if (!border && z <= 4) c = BLUE.dark;
set(X0, y, z, c);
}
box(1, 24, 11, 1, 25, 11, "#dfe2e5");
// The roof: flat, overhanging (more at the front), with a lamp on its front edge.
for (let x = 1; x <= 21; x++)
for (let y = 10; y <= 34; y++) {
const edge = x === 1 || x === 21 || y === 10 || y === 34;
set(x, y, TOP + 1, edge ? ROOF_EDGE : ROOF);
set(x, y, TOP + 2, edge ? ROOF : rand() < 0.1 ? ROOF : ROOF_TOP);
}
box(9, 10, TOP + 3, 13, 12, TOP + 3, "#2b2f36");
box(10, 10, TOP + 4, 12, 12, TOP + 5, "#ffd95a");
box(11, 10, TOP + 4, 11, 10, TOP + 5, "#fff6c9");
box(9, 10, TOP + 6, 13, 12, TOP + 6, "#2b2f36");
// The barrier, in line with the front of the booth: its cabinet, the red and white boom, and the post it rests on at
// the far end.
box(23, 14, 0, 26, 17, 11, "#50555d");
box(23, 14, 0, 26, 17, 0, "#3a3e45");
box(23, 14, 12, 26, 17, 12, "#f2c230");
box(24, 13, 4, 25, 13, 7, "#6a7079");
set(24, 13, 6, "#58c46a");
for (let x = 22; x <= 46; x++) {
const c = Math.floor((x - 22) / 4) % 2 ? "#f4f4f1" : "#d8362b";
box(x, 12, 9, x, 13, 10, c);
set(x, 12, 10, c === "#d8362b" ? "#e9554a" : "#ffffff");
}
box(21, 12, 8, 22, 13, 11, "#3a3e45"); // the counterweight
box(45, 14, 0, 46, 15, 8, "#70767d");
box(45, 11, 8, 46, 15, 8, "#70767d");
box(45, 11, 9, 46, 11, 10, "#70767d");
box(45, 14, 9, 46, 14, 10, "#70767d");
box(44, 13, 0, 46, 16, 0, "#50555d");import { draw } from "./assets/voxel";
import { guardBooth } from "./assets/guard-booth";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, guardBooth, 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 guard-booth
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["guard-booth"] })
# Queda en client/assets/guard-booth.ts
# https://fogon.gg/object/guard-booth