← CiudadObjeto 3Dfogon/auto-patrullero
Auto patrullero
Arrastrá para girarlo// «Auto patrullero» · gpt-6-sol (medium)
// A police patrol car: a sedan longer along y, white with a dark blue stripe and the word POLICIA on the sides, a light bar on the roof with a red and a blue lamp, dark windows and four black wheels.
const white = "#f5f4ed";
const shade = "#e0e4e3";
const blue = "#174a86";
const darkBlue = "#12365f";
const glass = "#263f55";
// Rounded, chunky sedan body: front faces -y.
box(14, 4, 5, 34, 44, 12, white);
box(12, 7, 5, 36, 41, 12, white);
box(13, 5, 6, 35, 43, 12, white);
box(13, 6, 5, 35, 42, 6, shade);
// Subtle paint variation, before adding the crisp details.
forEach((x, y, z, color) => {
if (color === white && rand() < 0.035)
set(x, y, z, rand() < 0.5 ? "#eceeea" : "#ffffff");
});
// Blue side stripes, with a narrow pale pinstripe above.
for (const x of [12, 36]) {
box(x, 8, 7, x, 40, 12, blue);
box(x, 8, 12, x, 40, 12, "#3774a9");
box(x, 8, 6, x, 40, 6, "#d1d7d5");
}
// Cabin, sloping visually into the windshield and rear window.
box(16, 16, 13, 32, 33, 18, shade);
box(17, 18, 19, 31, 31, 19, white);
box(17, 20, 20, 31, 30, 21, white);
box(18, 20, 21, 30, 30, 21, "#ffffff");
// Front and rear glass, stepped to suggest slanted windscreens.
box(18, 16, 15, 30, 16, 17, glass);
box(18, 17, 17, 30, 17, 18, "#304f68");
box(18, 18, 19, 30, 19, 19, "#385b72");
box(19, 17, 18, 22, 17, 18, "#7694a4");
box(18, 33, 15, 30, 33, 17, glass);
box(18, 32, 17, 30, 32, 18, "#304f68");
box(18, 31, 19, 30, 31, 19, "#385b72");
// Side windows, with thick white pillars between front and rear seats.
for (const x of [16, 32]) {
box(x, 18, 15, x, 22, 18, glass);
box(x, 24, 15, x, 30, 18, glass);
box(x, 18, 18, x, 21, 18, "#517187");
box(x, 24, 18, x, 28, 18, "#517187");
box(x, 23, 15, x, 23, 19, white);
box(x, 17, 14, x, 17, 19, white);
box(x, 31, 14, x, 31, 19, white);
}
// Door seams, handles, and mirrors.
for (const x of [12, 36]) {
for (const y of [23, 33]) box(x, y, 6, x, y, 7, darkBlue);
box(x, 21, 13, x, 23, 13, "#333d45");
box(x, 30, 13, x, 32, 13, "#333d45");
}
box(13, 17, 15, 15, 19, 16, "#e9eeee");
box(33, 17, 15, 35, 19, 16, "#e9eeee");
box(13, 17, 16, 14, 18, 16, "#364c5c");
box(34, 17, 16, 35, 18, 16, "#364c5c");
// Pixel lettering on both sides; the lettering sits proud of the stripe.
const glyphs = {
P: ["110", "101", "110", "100", "100"],
O: ["111", "101", "101", "101", "111"],
L: ["100", "100", "100", "100", "111"],
I: ["111", "010", "010", "010", "111"],
C: ["111", "100", "100", "100", "111"],
A: ["111", "101", "111", "101", "101"]
};
for (const x of [11, 37]) {
let y0 = 12;
for (const letter of "POLICIA") {
const rows = glyphs[letter];
for (let row = 0; row < 5; row++)
for (let col = 0; col < 3; col++)
if (rows[row][col] === "1")
set(x, y0 + col, 12 - row, "#ffffff");
y0 += 4;
}
}
// Front grille, headlights, bumper, and plate.
box(17, 4, 8, 31, 4, 10, darkBlue);
for (let x = 19; x <= 29; x += 2)
box(x, 3, 9, x, 3, 10, "#74828a");
box(14, 4, 9, 17, 4, 11, "#fff4bf");
box(31, 4, 9, 34, 4, 11, "#fff4bf");
box(15, 3, 6, 33, 3, 7, "#cbd1d0");
box(21, 2, 6, 27, 2, 7, "#f5e4b1");
box(22, 1, 7, 26, 1, 7, "#223c72");
// Rear lights and plate.
box(14, 44, 8, 18, 44, 11, "#df3840");
box(30, 44, 8, 34, 44, 11, "#df3840");
box(19, 44, 9, 29, 44, 10, "#d9e2e0");
box(21, 45, 6, 27, 45, 7, "#f5e4b1");
box(15, 45, 5, 33, 45, 5, "#b9c2c2");
// Small Buenos Aires-inspired sky-blue hood badge.
box(22, 9, 13, 26, 11, 13, "#75b9da");
box(23, 10, 13, 25, 10, 13, white);
set(24, 10, 14, "#efbb50");
// Fixed light-bar mount; only the lamps flash.
box(17, 23, 22, 31, 26, 22, "#26333f");
box(18, 22, 21, 19, 27, 21, "#737d83");
box(29, 22, 21, 30, 27, 21, "#737d83");
part("lightbar", [24, 24, 23]);
box(17, 23, 23, 23, 26, 25, "#ff2222");
box(25, 23, 23, 31, 26, 25, "#2255ff");
box(18, 23, 25, 22, 23, 25, "#ff8585");
box(26, 23, 25, 30, 23, 25, "#8ca5ff");
animate("lightbar", {
type: "colors",
palette: ["#ff2222", "#2255ff"],
pattern: "flicker",
glow: 1
});
part("body");
// Four individually spinning wheels, with visible hub spokes.
for (const side of ["left", "right"]) {
for (const [position, cy] of [["front", 11], ["rear", 38]]) {
const name = `${position}-${side}-wheel`;
const x0 = side === "left" ? 9 : 36;
const face = side === "left" ? 9 : 39;
part(name, [side === "left" ? 11 : 38, cy, 4]);
cylinder(x0, cy, 4, 4, 4, "#161c22", "x");
cylinder(face, cy, 4, 3, 1, "#303944", "x");
cylinder(face, cy, 4, 2, 1, "#aab5b9", "x");
set(face, cy, 4, "#344956");
for (const [dy, dz] of [[0, 2], [0, -2], [2, 0], [-2, 0]])
set(face, cy + dy, 4 + dz, "#e5e9e5");
animate(name, { type: "spin", axis: "x", speed: 6 });
}
}
part("body");import { draw } from "./assets/voxel";
import { autoPatrullero } from "./assets/auto-patrullero";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, autoPatrullero, 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 auto-patrullero
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["auto-patrullero"] })
# Queda en client/assets/auto-patrullero.ts
# https://fogon.page/object/auto-patrullero