← MedievalObjeto 3Dfogon/caballero-a-caballo
Caballero a caballo
Arrastrá para girarlo// «Caballero a caballo» · gpt-6-sol (medium)
// A chunky cartoon knight riding a horse, horizontal along y: a white horse with a blue-and-gold checkered caparison covering its body, head at the front (-y), and on top a knight in shiny grey plate armor with a closed helmet with a red plume, holding a long striped lance pointing forward and a blue shield with a gold lion.
// Four independently trotting legs.
function horseLeg(name, x, y, speed) {
part(name, [x, y, 15]);
box(x - 2, y - 2, 8, x + 2, y + 2, 15, "#d4d9d6");
box(x - 2, y - 2, 10, x + 1, y - 2, 15, "#f5f4eb");
box(x - 1, y - 1, 2, x + 1, y + 1, 9, "#eeeFE8");
box(x - 1, y - 1, 3, x - 1, y + 1, 8, "#c3cbca");
box(x - 2, y - 3, 0, x + 2, y + 2, 2, "#363b40");
box(x - 2, y - 3, 2, x + 2, y - 3, 2, "#62696a");
animate(name, { type: "swing", axis: "x", speed, amplitude: 0.3 });
}
horseLeg("front-left", 19, 15, 5);
horseLeg("front-right", 29, 15, -5);
horseLeg("rear-left", 19, 34, -5);
horseLeg("rear-right", 29, 34, 5);
part("body");
// Horse, neck, and expressive head.
ellipsoid(24, 25, 19, 7, 13, 6, "#e7e9e2");
ellipsoid(24, 24, 21, 6, 11, 4, "#faf8ee");
ellipsoid(24, 13, 25, 4, 6, 6, "#e1e5e1");
ellipsoid(24, 11, 27, 4, 4, 4, "#faf8ef");
box(21, 5, 23, 27, 10, 27, "#e9e9e3");
box(22, 4, 23, 26, 6, 25, "#d1d7d3");
for (const x of [20, 28]) {
box(x, 8, 27, x, 9, 28, "#272e31");
set(x, 8, 28, "#ffffff");
box(x, 5, 24, x, 5, 25, "#535c60");
box(x - 1, 10, 30, x, 12, 33, "#e4e6df");
set(x, 10, 33, "#f9f6eb");
}
box(21, 6, 22, 27, 9, 22, "#afb9b8");
// Dark mane and flowing tail.
for (let y = 15; y <= 20; y++) {
box(23, y, 28 - Math.floor((y - 15) / 2),
25, y + 1, 31 - Math.floor((y - 15) / 2), "#504644");
if (y % 2 === 0) set(24, y, 31 - Math.floor((y - 15) / 2), "#786358");
}
line(24, 37, 22, 24, 40, 18, 2, "#594b44");
line(24, 39, 19, 23, 42, 12, 2, "#514340");
line(25, 39, 18, 26, 42, 13, 1, "#766258");
// Blue-and-gold checked caparison, with a shaped hem.
const blue = "#24509a", blueLight = "#3769b2";
const gold = "#ddb34c", goldLight = "#f2cd70";
for (const x of [16, 32]) {
for (let y = 16; y <= 36; y++) {
const bottom = (y < 19 || y > 34) ? 17 : 14;
for (let z = bottom; z <= 24; z++) {
const check = (Math.floor((y - 16) / 4) + Math.floor((z - 14) / 4)) % 2;
const edge = z === bottom || z === 24 || y === 16 || y === 36;
const shade = check
? (rand() < 0.18 ? goldLight : gold)
: (rand() < 0.18 ? blueLight : blue);
set(x, y, z, edge ? "#e9bd58" : shade);
}
if (y >= 19 && y <= 34 && y % 4 === 1) {
box(x, y, 12, x, y + 1, 13, "#e7bb57");
set(x, y, 11, "#c79536");
}
}
}
for (let x = 17; x <= 31; x++) {
for (let y = 18; y <= 36; y++) {
const check = (Math.floor((x - 17) / 4) + Math.floor((y - 18) / 4)) % 2;
set(x, y, 25, check ? gold : blue);
}
}
box(17, 17, 25, 31, 17, 25, "#edc76c");
box(17, 36, 25, 31, 36, 25, "#bd8e37");
// Bridle, browband, and gold fittings.
for (const x of [20, 28]) {
line(x, 9, 27, x, 15, 27, 0, "#67443a");
line(x, 7, 24, x, 12, 24, 0, "#67443a");
set(x, 10, 27, "#e6bd5a");
}
box(21, 7, 29, 27, 8, 29, "#764c3d");
set(24, 7, 29, "#f1c869");
// Saddle, seated greaves, and boots.
box(19, 25, 26, 29, 31, 27, "#574039");
box(20, 25, 28, 28, 29, 29, "#a98755");
for (const x of [17, 30]) {
box(x, 24, 26, x + 2, 29, 29, "#9ba5ac");
box(x, 19, 25, x + 2, 24, 27, "#cbd2d3");
box(x, 18, 24, x + 2, 20, 25, "#535b63");
box(x, 19, 27, x + 2, 21, 27, "#edf0e9");
}
// Knight's breastplate and articulated shoulders.
ellipsoid(24, 25, 34, 6, 4, 6, "#aeb8be");
box(20, 21, 32, 28, 21, 37, "#e3e7e5");
box(22, 20, 33, 26, 20, 36, "#f5f3e9");
box(23, 20, 32, 25, 20, 32, "#737d86");
box(18, 22, 37, 21, 26, 39, "#dce2e0");
box(27, 22, 37, 31, 26, 39, "#dce2e0");
box(18, 22, 37, 19, 25, 39, "#f6f5ed");
box(30, 22, 37, 31, 25, 39, "#8d9aa3");
box(20, 21, 30, 28, 22, 30, "#69747d");
for (const x of [21, 24, 27]) set(x, 21, 30, "#edc667");
// Closed helmet, visor slit, and crimson crest.
ellipsoid(24, 23, 40, 4, 3, 3, "#bdc8cb");
box(21, 20, 39, 27, 20, 41, "#88959d");
box(22, 19, 40, 26, 19, 40, "#242c35");
box(21, 19, 41, 27, 19, 41, "#e4e9e6");
box(23, 19, 38, 25, 20, 39, "#c5cdd0");
for (const x of [21, 27]) set(x, 20, 39, "#e9c264");
box(23, 22, 43, 25, 27, 43, "#a57c36");
box(23, 20, 44, 25, 27, 45, "#ad2734");
box(23, 19, 45, 25, 24, 45, "#d83b43");
box(23, 26, 44, 25, 30, 44, "#842733");
set(24, 18, 44, "#ea5960");
// One arm reaches forward to grasp the lance.
line(20, 22, 36, 17, 18, 36, 2, "#a6b2b9");
box(16, 16, 35, 18, 19, 37, "#d9e0de");
box(16, 16, 35, 17, 18, 35, "#707e88");
// Long, diagonally carried, striped tournament lance.
for (let y = 5; y <= 27; y++) {
const z = Math.round(35 + (y - 5) * 3 / 22);
const stripe = Math.floor((y - 5) / 3) % 2;
const color = stripe ? "#f1e5c6" : "#a92e3a";
box(15, y, z, 16, y, z, color);
set(15, y, z + 1, stripe ? "#fff3d6" : "#d3444d");
}
line(15, 1, 34, 15, 5, 35, 0, "#e9c36a");
set(15, 1, 34, "#fff0aa");
box(14, 21, 37, 17, 21, 38, "#d3a74f");
box(14, 21, 38, 17, 21, 38, "#f2d277");
// The other arm carries a tall royal-blue shield on the visible side.
line(29, 23, 36, 32, 21, 34, 2, "#b4c0c5");
for (let z = 29; z <= 37; z++) {
const halfWidth = z <= 30 ? 2 : z >= 36 ? 3 : 4;
box(34, 21 - halfWidth, z, 34, 21 + halfWidth, z, "#d5a94b");
if (z > 29 && z < 37)
box(35, 22 - halfWidth, z, 35, 20 + halfWidth, z, "#21498f");
}
box(35, 18, 35, 35, 24, 35, "#e4ba55");
set(35, 21, 29, "#e4ba55");
// A bold, blocky golden lion emblem on the shield's outward face.
const lion = [
[20, 34], [21, 34], [22, 34],
[19, 33], [20, 33], [21, 33],
[20, 32], [21, 32], [22, 32], [23, 32],
[19, 31], [21, 31], [23, 31],
[19, 30], [23, 30]
];
for (const [y, z] of lion) set(36, y, z, "#f4ce69");
set(36, 20, 34, "#915b29");
set(36, 23, 33, "#f8dd87");import { draw } from "./assets/voxel";
import { caballeroACaballo } from "./assets/caballero-a-caballo";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, caballeroACaballo, 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-a-caballo
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["caballero-a-caballo"] })
# Queda en client/assets/caballero-a-caballo.ts
# https://fogon.page/object/caballero-a-caballo