← City3D assetfogon/ambulancia
Ambulancia
Drag to turn it// «Ambulancia» · gpt-6-sol (medium)
// An ambulance: a boxy van longer along y, white with a red stripe and red crosses on the sides and the back, a cab at the front (-y), a red and blue light bar on the roof and four black wheels.
const white = "#f5f3eb";
const shadow = "#d9dcd8";
const roofWhite = "#ffffff";
const red = "#e83939";
const redDark = "#bd292f";
const glass = "#79bad0";
const glassDark = "#3d819d";
const black = "#252b32";
// Undercarriage and bumpers.
box(15, 8, 5, 33, 41, 8, "#414950");
box(16, 4, 6, 32, 5, 9, "#aeb7b8");
box(15, 43, 6, 33, 44, 9, "#aeb7b8");
// Cab, hood, and tall ambulance compartment.
box(14, 6, 8, 34, 21, 17, white);
box(14, 6, 8, 34, 10, 13, shadow);
box(15, 12, 18, 33, 22, 19, roofWhite);
box(14, 20, 8, 34, 42, 22, white);
box(15, 21, 23, 33, 42, 23, roofWhite);
// Crisp lower edges and subtle panel shading.
box(14, 20, 8, 14, 42, 10, shadow);
box(34, 20, 8, 34, 42, 10, shadow);
box(14, 7, 8, 14, 19, 9, shadow);
box(34, 7, 8, 34, 19, 9, shadow);
forEach((x, y, z, color) => {
if (color === white && rand() < 0.045)
set(x, y, z, rand() < 0.5 ? "#ebece7" : "#ffffff");
});
// Front windshield, with a pale center pillar.
box(16, 10, 14, 32, 10, 17, glassDark);
box(17, 10, 16, 31, 10, 17, glass);
box(24, 9, 14, 24, 10, 17, white);
box(17, 9, 14, 21, 9, 14, black);
box(27, 9, 14, 31, 9, 14, black);
// Cab doors and windows on both sides.
for (const x of [13, 35]) {
box(x, 13, 14, x, 19, 17, glassDark);
box(x, 14, 16, x, 18, 17, glass);
box(x, 19, 10, x, 19, 13, shadow);
set(x + (x === 13 ? -1 : 1), 17, 12, black);
box(x, 11, 12, x, 41, 13, red);
box(x, 11, 11, x, 41, 11, redDark);
// Large, unmistakable red cross on the white side panel.
box(x + (x === 13 ? -1 : 1), 29, 16,
x + (x === 13 ? -1 : 1), 31, 21, red);
box(x + (x === 13 ? -1 : 1), 27, 18,
x + (x === 13 ? -1 : 1), 33, 19, red);
}
// Mirrors project from the front corners.
box(11, 10, 14, 13, 12, 16, black);
box(35, 10, 14, 37, 12, 16, black);
box(11, 9, 14, 11, 9, 15, glass);
box(37, 9, 14, 37, 9, 15, glass);
// Friendly face: headlights, grille, and plate.
for (const x of [16, 30]) {
box(x, 5, 10, x + 3, 5, 11, "#ffe7a4");
box(x, 4, 9, x + 3, 4, 9, "#e9ebd7");
}
box(22, 5, 9, 26, 5, 11, black);
for (const x of [23, 25]) box(x, 4, 9, x, 4, 10, "#8c999c");
box(21, 4, 7, 27, 4, 8, "#f3e8b8");
box(22, 3, 7, 26, 3, 7, "#273d57");
// Rear double doors, stripe, cross, and tail lamps.
box(15, 43, 9, 33, 43, 21, white);
box(15, 44, 9, 33, 44, 21, shadow);
box(16, 44, 10, 32, 44, 20, white);
box(24, 44, 9, 24, 44, 21, "#abb8b9");
box(15, 44, 12, 33, 44, 13, red);
box(23, 44, 16, 25, 44, 20, red);
box(20, 44, 17, 28, 44, 19, red);
for (const x of [15, 32]) {
box(x, 44, 8, x + 1, 44, 11, redDark);
set(x, 44, 10, "#ffae76");
}
set(22, 44, 10, black);
set(26, 44, 10, black);
// A roof cross stays legible from the game's top-down view.
box(22, 29, 24, 26, 37, 24, red);
box(18, 31, 24, 30, 35, 24, red);
box(16, 40, 24, 32, 40, 24, "#d9dee0");
// Fixed housing under the flashing light bar.
box(17, 13, 20, 31, 16, 20, black);
function wheel(name, x, y, outerFace) {
part(name, [x + 1, y, 4]);
for (let xx = x; xx <= x + 3; xx++) {
for (let dy = -4; dy <= 4; dy++) {
for (let dz = -4; dz <= 4; dz++) {
const d = dy * dy + dz * dz;
if (d <= 17) {
let color = d >= 10 ? "#22272c" : "#606a70";
if (d <= 4) color = "#a6b1b2";
if (d <= 1) color = "#464f54";
set(xx, y + dy, 4 + dz, color);
}
}
}
}
// Bright hub detail on the outward-facing surface.
set(outerFace, y, 4, "#d8dfe0");
for (const [dy, dz] of [[-2, 0], [2, 0], [0, -2], [0, 2]])
set(outerFace, y + dy, 4 + dz, "#d5dddb");
animate(name, { type: "spin", axis: "x", speed: 6 });
}
wheel("frontLeftWheel", 10, 13, 10);
wheel("frontRightWheel", 35, 13, 38);
wheel("rearLeftWheel", 10, 36, 10);
wheel("rearRightWheel", 35, 36, 38);
part("lightBar", [24, 15, 21]);
box(18, 13, 21, 23, 16, 22, "#ff2222");
box(24, 13, 21, 25, 16, 22, "#ffffff");
box(26, 13, 21, 30, 16, 22, "#2255ff");
animate("lightBar", {
type: "colors",
palette: ["#ff2222", "#2255ff", "#ffffff"],
pattern: "flicker",
glow: 1
});import { draw } from "./assets/voxel";
import { ambulancia } from "./assets/ambulancia";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, ambulancia, 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 ambulancia
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["ambulancia"] })
# It lands in client/assets/ambulancia.ts
# https://fogon.page/object/ambulancia