← Ancient and prehistory3D assetfogon/carro-romano
Carro romano
Drag to turn it// «Carro romano» · gpt-6-sol (medium)
// A Roman racing chariot: a small curved open cart in red and gold with an eagle emblem on the front, two big spoked wheels with iron rims on the sides, and a pole reaching forward (-y). No horse.
const red = "#a92e30";
const redLight = "#ca4540";
const redDark = "#792529";
const gold = "#efbd50";
const goldLight = "#ffdc78";
const bronze = "#9d6834";
const wood = "#75452d";
const iron = "#41464b";
// Cart floor and undercarriage.
box(17, 24, 8, 31, 38, 9, wood);
box(18, 25, 10, 30, 37, 10, "#b87943");
for (let y = 26; y <= 36; y += 3) {
box(18, y, 10, 30, y, 10, "#cb9155");
}
box(16, 25, 7, 32, 27, 8, redDark);
box(17, 29, 6, 31, 37, 7, redDark);
box(12, 30, 10, 36, 32, 12, wood);
box(12, 31, 11, 36, 31, 11, bronze);
// Curved, high front wall.
for (let x = 17; x <= 31; x++) {
const edge = Math.abs(x - 24);
const frontY = edge > 5 ? 22 : edge > 3 ? 21 : 20;
const top = edge > 5 ? 17 : edge > 3 ? 19 : 21;
for (let y = frontY; y <= 24; y++) {
for (let z = 9; z <= top; z++) {
set(x, y, z, z > top - 3 ? redLight : red);
}
set(x, frontY, top, goldLight);
set(x, frontY, 10, bronze);
}
}
// Sides slope down toward the open rear.
for (let y = 24; y <= 38; y++) {
const top = Math.round(19 - (y - 24) * 0.45);
for (const [x0, x1] of [[16, 18], [30, 32]]) {
box(x0, y, 9, x1, y, top - 1, y < 32 ? red : redDark);
box(x0, y, top, x1, y, top, gold);
set(x0, y, top, goldLight);
}
}
box(17, 37, 9, 31, 38, 10, redDark);
box(18, 38, 10, 30, 38, 10, gold);
// Gold borders and studs on the front.
for (let x = 18; x <= 30; x++) {
set(x, 19 + (Math.abs(x - 24) > 3 ? 1 : 0), 10, gold);
}
for (const x of [18, 30]) {
set(x, 21, 14, goldLight);
set(x, 21, 16, gold);
}
for (let y = 26; y <= 37; y += 3) {
for (const x of [16, 32]) set(x, y, 12, goldLight);
}
// Broad, readable golden eagle on the outward-facing front.
box(23, 19, 13, 25, 19, 17, gold);
box(24, 18, 18, 25, 19, 19, goldLight);
set(25, 17, 18, bronze); // Beak
set(24, 17, 19, "#382b23");
for (const side of [-1, 1]) {
line(24, 18, 17, 24 + side * 6, 20, 19, 1, gold);
line(24 + side * 3, 19, 17, 24 + side * 7, 21, 17, 0, goldLight);
line(24, 18, 14, 24 + side * 2, 19, 12, 0, goldLight);
}
set(24, 18, 15, goldLight);
// Forward-reaching wooden pole, with a bronze collar and short cross-yoke.
box(23, 5, 7, 25, 25, 8, wood);
box(23, 5, 9, 25, 23, 9, "#a66a39");
box(22, 20, 7, 26, 23, 10, bronze);
box(23, 4, 7, 25, 6, 9, gold);
box(19, 6, 8, 29, 7, 9, wood);
for (const x of [19, 29]) box(x, 5, 8, x, 8, 10, gold);
// Each wheel is a separate spinning part.
function wheel(name, cx) {
part(name, [cx, 31, 11]);
for (let y = 20; y <= 42; y++) {
for (let z = 0; z <= 22; z++) {
const d = Math.hypot(y - 31, z - 11);
if (d >= 9.7 && d <= 11.2) {
for (let x = cx - 1; x <= cx + 1; x++) {
set(x, y, z, d > 10.6 ? iron : "#626368");
}
} else if (d >= 8.7 && d < 9.7) {
for (let x = cx - 1; x <= cx + 1; x++) {
set(x, y, z, x === cx - 1 ? goldLight : bronze);
}
}
}
}
for (let i = 0; i < 8; i++) {
const a = i * Math.PI / 4;
const dy = Math.round(Math.cos(a) * 9);
const dz = Math.round(Math.sin(a) * 9);
line(cx, 31, 11, cx, 31 + dy, 11 + dz, 1, bronze);
line(cx - 1, 31, 11, cx - 1, 31 + dy, 11 + dz, 0, gold);
set(cx - 2, 31 + Math.round(Math.cos(a) * 10), 11 + Math.round(Math.sin(a) * 10), gold);
}
cylinder(cx - 2, 31, 11, 3, 4, bronze, "x");
cylinder(cx - 3, 31, 11, 2, 2, gold, "x");
set(cx - 4, 31, 11, goldLight);
animate(name, { type: "spin", axis: "x", speed: 4 });
part("body");
}
wheel("left wheel", 10);
wheel("right wheel", 38);import { draw } from "./assets/voxel";
import { carroRomano } from "./assets/carro-romano";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, carroRomano, 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 carro-romano
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["carro-romano"] })
# It lands in client/assets/carro-romano.ts
# https://fogon.page/object/carro-romano