← BásicoObjeto 3Dfogon/caballero
Caballero
Arrastrá para girarlo// «Caballero» · gpt-6-sol (medium)
// Knight («Caballero»).
const steel = "#aebdc4", light = "#dce5e5", white = "#f2f1e7";
const mid = "#879ca7", shadow = "#526a78", dark = "#344957";
const red = "#902c38", redHi = "#b8494d", redDark = "#652333";
const gold = "#d5a83e", goldHi = "#f0d16b", goldDark = "#98702d";
function rivet(x, y, z) {
set(x, y, z, goldHi);
set(x, y + 1, z, goldDark);
}
// Boots and legs, with the requested walking joints.
part("left_leg", [19, 25, 18]);
box(16, 22, 10, 22, 29, 18, shadow);
box(17, 20, 9, 22, 27, 17, steel);
box(17, 19, 12, 21, 20, 16, light);
box(16, 18, 4, 23, 30, 10, mid);
box(17, 17, 5, 22, 28, 10, light);
box(16, 15, 1, 23, 31, 3, redDark);
box(15, 14, 0, 24, 32, 1, "#43363b");
box(16, 14, 2, 23, 30, 3, steel);
box(17, 14, 4, 22, 16, 7, white);
box(16, 17, 9, 23, 28, 10, shadow);
box(17, 17, 10, 22, 26, 10, light);
animate("left_leg", {type:"swing", axis:"x", speed:-3.1, amplitude:0.3});
part("right_leg", [29, 25, 18]);
box(26, 22, 10, 32, 29, 18, shadow);
box(26, 20, 9, 31, 27, 17, steel);
box(27, 19, 12, 31, 20, 16, light);
box(25, 18, 4, 32, 30, 10, mid);
box(26, 17, 5, 31, 28, 10, light);
box(25, 15, 1, 32, 31, 3, redDark);
box(24, 14, 0, 33, 32, 1, "#43363b");
box(25, 14, 2, 32, 30, 3, steel);
box(26, 14, 4, 31, 16, 7, white);
box(25, 17, 9, 32, 28, 10, shadow);
box(26, 17, 10, 31, 26, 10, light);
animate("right_leg", {type:"swing", axis:"x", speed:3.1, amplitude:0.3});
part("body");
// Dark gaps between armor plates.
box(18, 20, 17, 30, 30, 30, dark);
box(17, 19, 21, 31, 30, 29, mid);
box(18, 18, 23, 30, 30, 30, steel);
box(19, 17, 25, 29, 18, 29, light);
box(18, 18, 29, 31, 29, 31, shadow);
box(19, 18, 30, 30, 28, 31, light);
// Broad breastplate, with layered lower edge.
box(18, 16, 21, 30, 19, 24, shadow);
box(19, 16, 23, 29, 17, 29, steel);
box(20, 15, 26, 28, 16, 29, light);
box(18, 17, 20, 31, 30, 21, goldDark);
box(19, 16, 21, 30, 18, 22, gold);
box(23, 15, 21, 26, 16, 23, goldHi);
rivet(19, 15, 22);
rivet(29, 15, 22);
// Red surcoat hangs below the belt.
box(19, 17, 11, 29, 26, 19, redDark);
box(20, 15, 12, 28, 17, 20, red);
box(21, 14, 13, 27, 15, 19, redHi);
box(19, 16, 11, 20, 25, 17, goldDark);
box(28, 16, 11, 29, 25, 17, goldDark);
box(20, 14, 12, 21, 15, 18, gold);
box(27, 14, 12, 28, 15, 18, gold);
box(20, 14, 11, 28, 16, 11, gold);
box(23, 13, 13, 25, 14, 20, gold);
box(21, 13, 16, 27, 14, 17, goldHi);
box(23, 13, 19, 25, 14, 21, goldHi);
// Neck and stepped great helm.
box(20, 20, 30, 28, 28, 33, shadow);
box(18, 19, 32, 30, 30, 38, steel);
box(19, 17, 32, 29, 29, 37, mid);
box(20, 16, 33, 28, 18, 37, shadow);
box(18, 19, 36, 30, 30, 38, light);
box(19, 20, 38, 29, 29, 39, steel);
box(20, 21, 40, 28, 28, 40, white);
box(22, 22, 41, 27, 27, 41, light);
// Readable black visor and nose guard on the front (-y).
box(19, 15, 34, 29, 16, 36, dark);
box(20, 14, 34, 28, 15, 36, "#202d36");
box(19, 14, 36, 29, 15, 36, shadow);
box(23, 13, 32, 25, 14, 37, light);
box(20, 14, 31, 28, 15, 32, steel);
box(20, 13, 32, 28, 14, 32, shadow);
box(18, 17, 32, 19, 27, 35, light);
box(29, 17, 32, 30, 27, 35, mid);
box(18, 16, 37, 30, 19, 38, white);
box(19, 15, 38, 29, 18, 38, mid);
rivet(18, 17, 34);
rivet(30, 17, 34);
// Raised rim and swept crimson plume.
box(23, 22, 41, 26, 27, 42, goldDark);
box(22, 24, 42, 27, 29, 43, redDark);
box(18, 26, 43, 25, 31, 44, red);
box(15, 28, 41, 20, 32, 44, redDark);
box(14, 29, 40, 17, 32, 42, red);
box(17, 27, 44, 23, 30, 45, redHi);
box(21, 26, 44, 26, 29, 45, redHi);
box(16, 30, 42, 18, 32, 43, redHi);
// Left shoulder, arm, gauntlet and heraldic shield.
part("left_arm", [13, 25, 29]);
box(11, 20, 25, 18, 30, 31, shadow);
box(10, 19, 27, 17, 29, 31, steel);
box(11, 18, 29, 17, 28, 31, light);
box(10, 19, 26, 18, 29, 27, mid);
box(11, 18, 26, 17, 27, 26, white);
box(12, 20, 20, 17, 27, 26, shadow);
box(11, 18, 20, 16, 26, 24, steel);
box(12, 17, 22, 16, 18, 25, light);
box(11, 17, 16, 17, 24, 21, mid);
box(12, 16, 17, 17, 21, 20, steel);
box(11, 15, 19, 17, 18, 20, light);
// Thick shield: dark bevel, red field, bright gold cross.
box(9, 14, 9, 18, 19, 21, dark);
box(10, 13, 8, 17, 18, 22, steel);
box(11, 12, 7, 16, 17, 22, shadow);
box(10, 11, 10, 17, 12, 21, goldDark);
box(11, 10, 9, 16, 11, 20, redDark);
box(11, 9, 10, 16, 10, 20, red);
box(12, 9, 7, 15, 11, 9, redDark);
box(12, 8, 11, 15, 9, 19, redHi);
box(11, 8, 19, 16, 9, 20, red);
box(13, 7, 10, 14, 8, 20, gold);
box(11, 7, 15, 16, 8, 17, gold);
box(13, 6, 12, 14, 7, 19, goldHi);
box(12, 6, 15, 15, 7, 16, goldHi);
rivet(11, 7, 19);
rivet(16, 7, 19);
rivet(12, 8, 10);
rivet(15, 8, 10);
animate("left_arm", {type:"swing", axis:"x", speed:3.1, amplitude:0.24});
// Right shoulder, arm, sword hand and upright sword.
part("right_arm", [35, 25, 29]);
box(31, 20, 26, 38, 30, 31, shadow);
box(32, 19, 27, 39, 29, 31, steel);
box(32, 18, 29, 38, 28, 31, light);
box(31, 19, 26, 39, 29, 27, mid);
box(32, 18, 26, 38, 27, 26, white);
box(33, 20, 20, 38, 27, 26, shadow);
box(34, 18, 20, 39, 26, 24, steel);
box(34, 17, 22, 38, 18, 25, light);
box(35, 17, 17, 40, 24, 21, mid);
box(36, 16, 18, 40, 21, 20, steel);
box(37, 15, 19, 40, 17, 20, gold);
// Brown grip, gold guard and faceted silver blade.
box(39, 17, 20, 40, 19, 27, goldDark);
box(39, 16, 22, 40, 17, 25, goldHi);
box(35, 16, 26, 43, 19, 27, goldDark);
box(36, 15, 27, 42, 18, 28, gold);
box(37, 15, 28, 41, 17, 28, goldHi);
box(38, 16, 29, 41, 19, 31, shadow);
box(39, 16, 31, 41, 19, 37, steel);
box(39, 16, 37, 40, 19, 41, steel);
box(39, 16, 42, 40, 18, 43, light);
box(39, 15, 31, 39, 15, 41, white);
box(40, 16, 31, 40, 16, 40, light);
box(41, 18, 31, 41, 19, 37, shadow);
animate("right_arm", {type:"swing", axis:"x", speed:-3.1, amplitude:0.24});import { draw } from "./assets/voxel";
import { caballero } from "./assets/caballero";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, caballero, 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 caballero
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["caballero"] })
# Queda en client/assets/caballero.ts
# https://fogon.page/object/caballero