← AsiáticoObjeto 3Dfogon/ninja
Ninja
Arrastrá para girarlo// «Ninja» · gpt-6-sol (medium)
// A chunky cartoon ninja standing facing front (-y): dark navy wrapped outfit with a red sash belt, a hood covering the head with only a skin-colored band and two determined black eyes visible, a short katana handle sticking up behind one shoulder, black tabi boots, small wrapped forearms.
// Chunky cartoon ninja, facing -y.
const navy = "#17243a";
const navyLight = "#273b56";
const navyDark = "#101a2c";
const wrap = "#394d65";
const red = "#a9222e";
const redLight = "#d34345";
const redDark = "#711d2a";
const gold = "#d6a94c";
const skin = "#e6b789";
const skinShade = "#c98e69";
const black = "#111622";
// Katana and sheath, rising behind the ninja's right shoulder.
line(30, 31, 23, 35, 31, 36, 2, "#303640");
line(30, 29, 23, 35, 29, 36, 0, gold);
box(34, 28, 35, 37, 32, 36, gold); // guard
line(35, 31, 37, 38, 31, 42, 1, "#442b30");
line(36, 29, 39, 38, 29, 41, 0, gold);
box(37, 29, 42, 39, 32, 43, gold);
// Solid, broad torso and raised collar.
ellipsoid(24, 24, 23, 10, 7, 9, navy);
ellipsoid(24, 24, 26, 9, 7, 6, navyLight);
box(16, 17, 19, 32, 19, 28, navy);
box(18, 16, 28, 30, 21, 32, navyDark);
// Overlapping diagonal folds on the front of the jacket.
line(17, 16, 29, 27, 16, 20, 0, wrap);
line(30, 16, 29, 21, 16, 20, 0, navyDark);
line(18, 16, 27, 26, 16, 20, 0, navyLight);
// Red lacquer-colored sash, with a hanging knot and tails.
box(15, 17, 16, 33, 31, 19, redDark);
box(15, 16, 18, 33, 18, 19, red);
box(16, 16, 16, 32, 17, 17, redLight);
box(22, 14, 16, 27, 17, 20, red);
box(23, 13, 17, 26, 14, 19, redLight);
box(25, 15, 10, 28, 17, 16, redDark);
box(25, 14, 12, 27, 15, 16, red);
box(20, 16, 13, 22, 17, 16, redDark);
set(26, 14, 11, gold);
// Hood: a rounded silhouette, dark face mask, and narrow exposed eye band.
ellipsoid(24, 23, 35, 10, 9, 8, navyDark);
ellipsoid(24, 22, 38, 9, 8, 5, navy);
box(18, 12, 34, 30, 15, 37, skinShade);
box(19, 11, 35, 29, 13, 36, skin);
box(18, 11, 32, 30, 15, 34, navyDark);
box(17, 12, 37, 31, 16, 39, navy);
box(19, 12, 39, 29, 17, 40, navyLight);
// Angled brows and two determined black eyes.
line(19, 10, 37, 22, 10, 36, 0, navyDark);
line(26, 10, 36, 29, 10, 37, 0, navyDark);
box(20, 10, 35, 21, 11, 36, black);
box(27, 10, 35, 28, 11, 36, black);
set(20, 9, 36, "#6d625b");
set(27, 9, 36, "#6d625b");
// Folded hood seams.
line(17, 17, 38, 19, 15, 41, 0, navyLight);
line(31, 17, 38, 29, 15, 41, 0, navyLight);
line(20, 19, 42, 28, 19, 42, 0, wrap);
// Left leg and forward-pointing split-toe boot.
part("leftLeg", [19, 24, 17]);
ellipsoid(19, 24, 12, 5, 5, 7, navy);
box(15, 19, 6, 22, 29, 13, navy);
box(15, 18, 5, 22, 27, 7, navyLight);
box(14, 16, 0, 23, 29, 5, black);
box(14, 14, 0, 18, 18, 3, black);
box(20, 14, 0, 23, 18, 3, black);
box(19, 14, 0, 19, 17, 2, navyLight);
box(15, 17, 4, 22, 19, 4, wrap);
animate("leftLeg", { type: "swing", axis: "x", speed: 4, amplitude: 0.3 });
// Right leg.
part("rightLeg", [29, 24, 17]);
ellipsoid(29, 24, 12, 5, 5, 7, navy);
box(26, 19, 6, 33, 29, 13, navy);
box(26, 18, 5, 33, 27, 7, navyLight);
box(25, 16, 0, 34, 29, 5, black);
box(25, 14, 0, 28, 18, 3, black);
box(30, 14, 0, 34, 18, 3, black);
box(29, 14, 0, 29, 17, 2, navyLight);
box(26, 17, 4, 33, 19, 4, wrap);
animate("rightLeg", { type: "swing", axis: "x", speed: -4, amplitude: 0.3 });
// Left sleeve, wrapped forearm, and small gloved fist.
part("leftArm", [14, 24, 29]);
ellipsoid(12, 24, 25, 5, 5, 6, navy);
box(9, 20, 17, 14, 28, 25, navy);
box(9, 18, 15, 14, 27, 19, navyLight);
box(8, 18, 12, 14, 26, 16, navyDark);
box(9, 17, 17, 14, 19, 18, wrap);
box(9, 17, 14, 14, 19, 15, wrap);
box(9, 17, 12, 14, 19, 12, gold);
animate("leftArm", { type: "swing", axis: "x", speed: -4, amplitude: 0.25 });
// Right sleeve, wrapped forearm, and glove.
part("rightArm", [34, 24, 29]);
ellipsoid(36, 24, 25, 5, 5, 6, navy);
box(34, 20, 17, 39, 28, 25, navy);
box(34, 18, 15, 39, 27, 19, navyLight);
box(34, 18, 12, 40, 26, 16, navyDark);
box(34, 17, 17, 39, 19, 18, wrap);
box(34, 17, 14, 39, 19, 15, wrap);
box(34, 17, 12, 39, 19, 12, gold);
animate("rightArm", { type: "swing", axis: "x", speed: 4, amplitude: 0.25 });
part("body", [24, 24, 23]);import { draw } from "./assets/voxel";
import { ninja } from "./assets/ninja";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, ninja, 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 ninja
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["ninja"] })
# Queda en client/assets/ninja.ts
# https://fogon.page/object/ninja