← Basics3D assetfogon/robot-retro
Robot retro
Drag to turn it// «Robot retro» · gpt-6-sol (medium)
// Robot («Robot retro»).
const teal = "#299b9e";
const light = "#62d0cf";
const pale = "#b5e5dc";
const darkTeal = "#17636c";
const shadow = "#243b43";
const deep = "#172b35";
const cream = "#e2dfbd";
const brass = "#b89a52";
const gold = "#ddbb6b";
const rust = "#a85d36";
const orange = "#d98448";
function rivet(x, y, z) {
set(x, y, z, gold);
}
// Feet and legs
for (const [x0, x1] of [[13, 22], [27, 36]]) {
box(x0 + 1, 21, 5, x1 - 1, 30, 16, shadow);
box(x0 + 1, 20, 7, x1 - 1, 29, 15, darkTeal);
box(x0 + 2, 19, 10, x1 - 2, 28, 15, teal);
box(x0, 17, 3, x1, 32, 7, shadow);
box(x0, 11, 1, x1, 31, 5, teal);
box(x0, 11, 5, x1, 29, 6, light);
box(x0, 10, 0, x1, 14, 3, cream);
box(x0, 10, 0, x1, 11, 2, shadow);
box(x0 + 1, 10, 3, x1 - 1, 12, 4, pale);
box(x0, 14, 1, x0 + 1, 29, 3, darkTeal);
box(x1 - 1, 15, 1, x1, 29, 3, darkTeal);
box(x0 + 2, 13, 6, x1 - 2, 17, 6, pale);
box(x0 + 2, 19, 12, x1 - 2, 21, 14, gold);
box(x0 + 3, 18, 11, x1 - 3, 18, 12, rust);
}
box(15, 20, 15, 21, 29, 18, rust);
box(28, 20, 15, 34, 29, 18, rust);
// Neck, torso, and squared-off shoulders
box(21, 22, 29, 27, 29, 33, shadow);
box(22, 21, 30, 26, 28, 32, brass);
box(12, 19, 17, 36, 33, 29, shadow);
box(13, 18, 19, 35, 32, 29, darkTeal);
box(14, 18, 20, 34, 31, 29, teal);
box(13, 18, 28, 35, 32, 30, light);
box(14, 19, 30, 34, 31, 30, pale);
box(12, 20, 26, 14, 32, 29, light);
box(34, 20, 26, 36, 32, 29, darkTeal);
box(12, 19, 17, 36, 33, 19, cream);
box(14, 18, 19, 34, 32, 20, brass);
box(16, 17, 17, 32, 19, 18, shadow);
// Recessed chest control panel
box(17, 16, 22, 32, 18, 28, shadow);
box(18, 15, 23, 31, 16, 27, cream);
box(19, 14, 24, 30, 15, 26, deep);
box(20, 13, 25, 29, 14, 26, pale);
box(21, 12, 25, 28, 13, 25, darkTeal);
box(18, 14, 28, 31, 17, 28, brass);
box(17, 15, 22, 32, 17, 22, gold);
for (const x of [20, 24, 28]) {
box(x, 13, 20, x + 1, 15, 21, rust);
set(x, 12, 21, orange);
}
box(33, 17, 20, 35, 19, 23, orange);
box(13, 17, 20, 15, 19, 23, brass);
for (let i = 0; i < 12; i++) {
const x = 16 + Math.floor(rand() * 18);
const y = 19 + Math.floor(rand() * 12);
set(x, y, 30, rand() < 0.5 ? light : pale);
}
// Left articulated arm
part("left_arm", [9, 24, 26]);
box(7, 21, 23, 12, 30, 29, shadow);
box(5, 21, 24, 10, 29, 28, teal);
box(5, 21, 28, 10, 28, 29, light);
box(4, 23, 25, 5, 28, 27, cream);
box(6, 20, 20, 11, 29, 24, darkTeal);
box(5, 19, 19, 10, 28, 21, light);
box(6, 20, 16, 10, 27, 19, teal);
box(5, 19, 17, 11, 21, 19, cream);
box(6, 18, 14, 10, 23, 17, rust);
box(6, 17, 12, 9, 22, 14, orange);
box(9, 17, 13, 11, 20, 16, brass);
box(3, 23, 21, 5, 27, 24, brass);
box(2, 24, 22, 3, 26, 23, deep);
rivet(4, 22, 26);
animate("left_arm", { type: "swing", axis: "x", speed: 1.8, amplitude: 0.36 });
// Right articulated arm
part("right_arm", [39, 24, 26]);
box(36, 21, 23, 41, 30, 29, shadow);
box(38, 21, 24, 43, 29, 28, teal);
box(38, 21, 28, 43, 28, 29, light);
box(43, 23, 25, 44, 28, 27, cream);
box(37, 20, 20, 42, 29, 24, darkTeal);
box(38, 19, 19, 43, 28, 21, light);
box(38, 20, 16, 42, 27, 19, teal);
box(37, 19, 17, 43, 21, 19, cream);
box(38, 18, 14, 42, 23, 17, rust);
box(39, 17, 12, 42, 22, 14, orange);
box(37, 17, 13, 39, 20, 16, brass);
box(43, 23, 21, 45, 27, 24, brass);
box(45, 24, 22, 46, 26, 23, deep);
rivet(44, 22, 26);
animate("right_arm", { type: "swing", axis: "x", speed: 1.8, amplitude: -0.36 });
// Oversized retro television head
part("head", [24, 24, 31]);
box(11, 17, 32, 37, 34, 40, shadow);
box(10, 18, 34, 38, 33, 40, darkTeal);
box(11, 16, 34, 37, 32, 40, teal);
box(11, 17, 39, 37, 33, 42, light);
box(13, 17, 42, 35, 31, 42, pale);
box(10, 18, 39, 38, 33, 40, darkTeal);
box(11, 16, 40, 37, 31, 41, light);
box(13, 15, 39, 35, 17, 40, cream);
box(15, 14, 40, 33, 16, 40, pale);
// Dark faceplate and stepped silver frame
box(13, 14, 33, 35, 17, 39, cream);
box(14, 13, 34, 34, 15, 38, shadow);
box(15, 12, 34, 33, 14, 38, deep);
box(11, 16, 33, 13, 31, 38, darkTeal);
box(35, 16, 33, 37, 31, 38, darkTeal);
box(11, 17, 35, 11, 32, 39, light);
box(37, 17, 35, 37, 32, 39, light);
box(14, 15, 32, 34, 31, 33, darkTeal);
box(15, 14, 33, 33, 16, 33, brass);
// Two chunky, projecting goggle eyes
for (const x of [18, 28]) {
box(x - 2, 10, 35, x + 4, 14, 39, brass);
box(x - 1, 9, 36, x + 3, 11, 38, cream);
box(x, 8, 36, x + 2, 9, 38, deep);
box(x, 7, 37, x + 1, 8, 38, gold);
set(x, 7, 38, pale);
box(x - 2, 11, 35, x - 1, 12, 36, rust);
box(x + 3, 11, 38, x + 4, 12, 39, gold);
}
box(23, 11, 33, 26, 13, 34, brass);
box(24, 10, 33, 25, 11, 33, cream);
// Ear-like copper bolts on the sides
box(7, 22, 34, 10, 28, 37, brass);
box(6, 23, 35, 8, 27, 37, rust);
box(5, 24, 36, 6, 26, 37, orange);
box(38, 22, 34, 41, 28, 37, brass);
box(40, 23, 35, 42, 27, 37, rust);
box(42, 24, 36, 43, 26, 37, orange);
// Inset roof markings and tiny corner fasteners
box(16, 19, 43, 32, 30, 43, darkTeal);
box(17, 19, 43, 31, 28, 43, pale);
box(20, 20, 43, 28, 27, 43, light);
for (const x of [14, 35]) {
for (const y of [19, 31]) rivet(x, y, 42);
}
animate("head", { type: "swing", axis: "z", speed: 0.65, amplitude: 0.24 });
// Spinning brass-and-copper rooftop antenna
part("antenna", [24, 24, 41]);
box(22, 22, 42, 26, 26, 43, brass);
box(23, 23, 43, 25, 25, 45, darkTeal);
box(24, 23, 45, 24, 25, 46, gold);
box(22, 23, 46, 27, 25, 46, rust);
box(26, 22, 46, 28, 26, 46, orange);
set(28, 24, 46, cream);
animate("antenna", { type: "spin", axis: "z", speed: 2.1 });import { draw } from "./assets/voxel";
import { robotRetro } from "./assets/robot-retro";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, robotRetro, 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 robot-retro
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["robot-retro"] })
# It lands in client/assets/robot-retro.ts
# https://fogon.page/object/robot-retro