← Asian3D assetfogon/samurai
Samurái
Drag to turn it// «Samurái» · gpt-6-sol (medium)
// A samurai warrior standing, chunky and readable: red and black lacquered armor plates, a helmet with golden crescent horns, dark face mask, a katana held in the right hand. Arms and legs are moving parts.
// Lacquered samurai, facing -y
const black = "#171c20", ink = "#101519", dark = "#29282a";
const red = "#a72825", redHi = "#d44735", redDark = "#76201f";
const gold = "#d9a64c", goldHi = "#f4d177", goldDark = "#94692f";
const steel = "#b8c8ca", steelHi = "#eef2e8";
// Torso: broad shoulders, narrow waist
box(18, 20, 19, 30, 28, 30, black);
box(17, 19, 25, 31, 29, 30, redDark);
box(18, 18, 26, 30, 19, 30, red);
box(19, 17, 27, 29, 17, 29, redHi);
box(23, 16, 25, 25, 17, 30, black); // central armor seam
box(23, 16, 28, 25, 16, 29, gold);
// Overlapping breastplate rows
for (let z = 22; z <= 28; z += 3) {
box(18, 17, z, 22, 18, z + 1, red);
box(26, 17, z, 30, 18, z + 1, red);
box(18, 16, z, 22, 16, z, redHi);
box(26, 16, z, 30, 16, z, redHi);
box(18, 16, z + 2, 22, 16, z + 2, goldDark);
box(26, 16, z + 2, 30, 16, z + 2, goldDark);
}
box(17, 18, 20, 31, 28, 21, black);
box(18, 17, 20, 30, 17, 21, goldDark);
box(22, 16, 20, 26, 16, 22, gold);
box(23, 15, 21, 25, 15, 21, goldHi);
// Flared armored skirt
box(16, 19, 16, 32, 29, 19, redDark);
for (let x = 16; x <= 30; x += 4) {
box(x, 17, 16, x + 2, 19, 19, red);
box(x, 16, 18, x + 2, 16, 19, redHi);
box(x, 16, 16, x + 2, 16, 16, goldDark);
set(x + 1, 15, 18, gold);
}
box(22, 16, 16, 26, 17, 19, black);
// Neck and masked face
box(21, 20, 30, 27, 26, 33, black);
box(20, 19, 32, 28, 27, 37, dark);
box(21, 17, 33, 27, 19, 35, "#bd9271");
box(20, 16, 30, 28, 19, 33, black);
box(21, 15, 32, 27, 15, 33, "#383b3a");
box(22, 14, 31, 26, 15, 31, redDark);
box(21, 16, 34, 23, 16, 34, ink);
box(25, 16, 34, 27, 16, 34, ink);
set(22, 15, 34, goldHi);
set(26, 15, 34, goldHi);
box(23, 14, 33, 25, 14, 33, goldDark);
// Kabuto helmet, flared neck guard and deep brow
box(19, 19, 36, 29, 28, 39, redDark);
box(20, 18, 38, 28, 27, 40, red);
box(22, 19, 40, 26, 26, 41, redHi);
box(17, 18, 35, 31, 29, 37, black);
box(17, 17, 36, 31, 20, 37, red);
box(18, 16, 37, 30, 18, 38, redHi);
box(18, 15, 36, 30, 17, 36, goldDark);
box(19, 17, 33, 20, 26, 36, redDark);
box(28, 17, 33, 29, 26, 36, redDark);
box(23, 15, 37, 25, 16, 40, gold);
set(24, 14, 39, goldHi);
// Gold crescent ornament: thick at the base, tapering to two raised tips
line(24, 14, 39, 18, 14, 39, 1, gold);
line(18, 14, 39, 14, 14, 41, 1, gold);
line(14, 14, 41, 11, 14, 44, 0, goldHi);
line(24, 14, 39, 30, 14, 39, 1, gold);
line(30, 14, 39, 34, 14, 41, 1, gold);
line(34, 14, 41, 37, 14, 44, 0, goldHi);
box(22, 13, 38, 26, 13, 39, goldDark);
box(23, 12, 39, 25, 12, 39, goldHi);
// Left arm, swinging forward as the right leg advances
part("leftArm", [17, 24, 28]);
box(14, 20, 24, 19, 28, 29, black);
box(13, 18, 26, 19, 28, 30, redDark);
box(14, 17, 28, 19, 19, 30, redHi);
box(13, 17, 26, 19, 17, 26, gold);
box(15, 19, 19, 18, 26, 25, redDark);
box(15, 18, 20, 18, 19, 23, red);
box(15, 17, 21, 18, 17, 21, goldDark);
box(15, 19, 17, 18, 25, 19, black);
box(14, 18, 16, 19, 23, 18, red);
box(15, 17, 17, 18, 17, 17, goldDark);
animate("leftArm", { type: "swing", axis: "x", speed: 3, amplitude: 0.3 });
// Right arm and its held katana
part("rightArm", [31, 24, 28]);
box(29, 20, 24, 34, 28, 29, black);
box(29, 18, 26, 35, 28, 30, redDark);
box(29, 17, 28, 34, 19, 30, redHi);
box(29, 17, 26, 35, 17, 26, gold);
box(31, 19, 19, 34, 26, 25, redDark);
box(31, 18, 20, 34, 19, 23, red);
box(31, 17, 21, 34, 17, 21, goldDark);
box(32, 19, 17, 35, 25, 19, black);
box(32, 18, 16, 36, 23, 18, red);
box(33, 17, 17, 36, 17, 17, goldDark);
// Wrapped grip, oval guard, and upward-slanting silver blade
line(35, 17, 17, 38, 17, 24, 1, ink);
for (let z = 18; z <= 22; z += 2) set(36 + Math.round((z - 18) / 3), 15, z, gold);
line(35, 17, 22, 40, 17, 24, 1, gold);
line(35, 17, 22, 40, 17, 24, 0, goldHi);
line(38, 17, 24, 43, 17, 38, 1, steel);
line(39, 16, 25, 43, 16, 37, 0, steelHi);
line(43, 17, 38, 44, 17, 40, 0, steelHi);
animate("rightArm", { type: "swing", axis: "x", speed: -3, amplitude: 0.3 });
// Left leg
part("leftLeg", [20, 24, 17]);
box(17, 21, 8, 22, 28, 17, black);
box(16, 19, 10, 22, 27, 15, redDark);
box(17, 17, 11, 22, 19, 14, red);
box(17, 16, 13, 22, 16, 13, gold);
box(17, 18, 5, 22, 27, 10, redDark);
box(17, 16, 6, 22, 18, 9, red);
box(17, 15, 8, 22, 15, 8, goldDark);
box(16, 17, 0, 22, 29, 4, black);
box(16, 14, 1, 22, 19, 3, redDark);
box(17, 13, 2, 22, 14, 2, goldDark);
animate("leftLeg", { type: "swing", axis: "x", speed: -3, amplitude: 0.3 });
// Right leg
part("rightLeg", [28, 24, 17]);
box(26, 21, 8, 31, 28, 17, black);
box(26, 19, 10, 32, 27, 15, redDark);
box(26, 17, 11, 31, 19, 14, red);
box(26, 16, 13, 31, 16, 13, gold);
box(26, 18, 5, 31, 27, 10, redDark);
box(26, 16, 6, 31, 18, 9, red);
box(26, 15, 8, 31, 15, 8, goldDark);
box(26, 17, 0, 32, 29, 4, black);
box(26, 14, 1, 32, 19, 3, redDark);
box(26, 13, 2, 31, 14, 2, goldDark);
animate("rightLeg", { type: "swing", axis: "x", speed: 3, amplitude: 0.3 });
part("body", [24, 24, 20]);import { draw } from "./assets/voxel";
import { samurai } from "./assets/samurai";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, samurai, 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 samurai
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["samurai"] })
# It lands in client/assets/samurai.ts
# https://fogon.page/object/samurai