← MedievalObjeto 3Dfogon/diana-de-tiro
Diana de tiro
Arrastrá para girarlo// «Diana de tiro» · gpt-6-sol (medium)
// A medieval archery target: a round straw target face with painted rings (white, black, blue, red and a yellow center) standing on a wooden tripod easel, with two arrows with red feathers stuck in it, one near the center.
// Timber tripod: the rear leg and cross-brace sit behind the target.
line(24, 29, 34, 24, 39, 0, 2, "#493022");
line(24, 29, 34, 9, 18, 0, 2, "#593721");
line(24, 29, 34, 39, 18, 0, 2, "#593721");
line(13, 21, 9, 35, 21, 9, 1, "#6b4529");
line(17, 23, 17, 31, 23, 17, 1, "#503321");
// Squared-off feet and iron reinforcement.
box(6, 15, 0, 12, 21, 1, "#493022");
box(36, 15, 0, 42, 21, 1, "#493022");
box(21, 36, 0, 27, 42, 1, "#493022");
line(10, 19, 4, 12, 20, 8, 2, "#25282b");
line(38, 19, 4, 36, 20, 8, 2, "#25282b");
set(10, 16, 6, "#b69b67");
set(38, 16, 6, "#b69b67");
// Solid round backing, with a thick, irregular straw edge.
const cx = 24, cz = 27;
for (let x = 7; x <= 41; x++) {
for (let z = 10; z <= 44; z++) {
const d = Math.hypot(x - cx, z - cz);
if (d > 17.1) continue;
for (let y = 14; y <= 21; y++) {
let color;
if (y >= 20) {
color = rand() < 0.18 ? "#634025" : "#4b3022";
} else {
const shades = ["#a77838", "#bc8b45", "#c99b52", "#d0a75c"];
color = shades[Math.floor(rand() * shades.length)];
if (z < cz - 5 && rand() < 0.32) color = "#936c37";
}
set(x, y, z, color);
}
if (d <= 15.4) {
// Traditional archery scoring rings, from outside inward.
let shades;
if (d > 12.5) shades = ["#e6ddc5", "#d5ccb4", "#f0e6d0"];
else if (d > 9.6) shades = ["#252830", "#30343b", "#383a3d"];
else if (d > 6.8) shades = ["#245589", "#30679b", "#1b487c"];
else if (d > 4.0) shades = ["#aa3034", "#bb3c3a", "#922a30"];
else shades = ["#e7ac35", "#f0bd48", "#d8992b"];
let color = shades[rand() < 0.78 ? 0 : 1 + Math.floor(rand() * 2)];
if (z > cz + 4 && rand() < 0.1) color = shades[2];
set(x, 13, z, color);
} else {
const straw = ["#dfb66c", "#c99b50", "#ead083", "#ad7d38"];
set(x, 13, z, straw[Math.floor(rand() * straw.length)]);
}
// Raised, braided straw border in front of the painted canvas.
if (d > 15.25 && d < 17.1) {
const braid = ((x + z) % 4 + 4) % 4;
set(x, 12, z, ["#e5bb70", "#b8843d", "#f0ce88", "#c99a4d"][braid]);
}
}
}
// A few short straw ends poke out from the circular binding.
for (let i = 0; i < 95; i++) {
const a = rand() * Math.PI * 2;
const r = 16.7 + rand() * 0.6;
const x = Math.round(cx + Math.cos(a) * r);
const z = Math.round(cz + Math.sin(a) * r);
if (z >= 10 && z <= 44) {
set(x, 12 + Math.floor(rand() * 3), z,
rand() < 0.5 ? "#e8c77d" : "#a77738");
}
}
// Arrow shafts project toward the viewer; red feather pairs mark their tails.
function arrow(x, z, tailY) {
line(x, tailY, z, x, 12, z, 0, "#d5ad70");
set(x, 12, z, "#38332c"); // buried iron point
set(x, 11, z, "#9a784b");
for (let y = tailY + 1; y <= tailY + 4; y++) {
const reach = y <= tailY + 2 ? 2 : 1;
for (let dx = -reach; dx <= reach; dx++) {
if (dx === 0) continue;
set(x + dx, y, z, dx < 0 ? "#a72e32" : "#c3433c");
}
set(x, y, z + 1, "#b73537");
if (y <= tailY + 2) set(x, y, z - 1, "#82292c");
}
set(x, tailY, z, "#ead5a5");
}
arrow(22, 27, 3);
arrow(32, 33, 5);import { draw } from "./assets/voxel";
import { dianaDeTiro } from "./assets/diana-de-tiro";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, dianaDeTiro, 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 diana-de-tiro
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["diana-de-tiro"] })
# Queda en client/assets/diana-de-tiro.ts
# https://fogon.page/object/diana-de-tiro