← ArmasObjeto 3Dfogon/arma-pistola
Pistola
Arrastrá para girarlo// «Pistola» · propio
// A black semi-automatic pistol with a grey slide and a brown grip.
const colors = () => {};
const SL = "#9aa1a9", SM = "#737a82", SD = "#4f555c";
const DK = "#2b2f33", DK2 = "#181b1e", DK3 = "#3c4147";
const BL = "#ad7642", BM = "#8a5a2e", BD = "#63401e";
// ===== SLIDE (grey) =====
box(28, 5, 0, 36, 41, 5, SM);
box(35, 5, 0, 36, 41, 5, SL);
box(28, 5, 0, 28, 41, 5, SD);
// nose chamfer
box(35, 5, 0, 36, 6, 5, null);
box(36, 5, 0, 36, 8, 5, null);
// muzzle bore
box(30, 5, 1, 32, 6, 4, DK2);
// sights
box(37, 9, 1, 38, 11, 4, DK2);
box(37, 35, 1, 38, 39, 4, DK2);
// ===== FRAME (black) =====
box(23, 7, 0, 27, 41, 5, DK);
box(23, 7, 0, 23, 41, 5, DK2);
// ===== TRIGGER GUARD =====
box(15, 19, 0, 17, 30, 5, DK);
box(15, 19, 0, 23, 21, 5, DK);
box(15, 28, 0, 23, 31, 5, DK);
box(15, 19, 0, 15, 31, 5, DK2);
// ===== TRIGGER =====
part("trigger", [22, 24, 3]);
box(18, 23, 1, 22, 25, 4, DK3);
part("body");
// ===== GRIP (brown) =====
for (let x = 10; x <= 24; x++) {
const t = (24 - x) / 14;
const y0 = 30 + Math.round(t * 3);
const y1 = 42 + Math.round(t * 1);
box(x, y0, 0, x, y1, 5, BM);
box(x, y0, 0, x, y0, 5, BD);
box(x, y1, 0, x, y1, 5, BD);
}
// magazine base plate
box(8, 35, 0, 9, 43, 5, DK2);
// ===== HAMMER =====
part("hammer", [26, 41, 3]);
box(26, 41, 1, 29, 44, 4, DK2);
part("body");
// ===== DETAILS =====
// ejection port
box(33, 22, 4, 36, 28, 5, DK2);
// slide serrations
for (let y = 34; y <= 40; y += 2) box(28, y, 4, 36, y, 5, SD);
// slide stop lever
box(25, 16, 4, 27, 20, 5, DK3);
// grip checkering
for (let x = 11; x <= 23; x++) {
for (let y = 30; y <= 43; y++) {
if (get(x, y, 5) === BM && ((x + y) % 2 === 0)) set(x, y, 5, BL);
}
}
// grip screw
box(15, 37, 5, 16, 38, 5, DK2);
// ===== ANIMATION =====
animate("trigger", { type: "swing", axis: "z", speed: 2.4, amplitude: 0.22 });
animate("hammer", { type: "swing", axis: "z", speed: 2.4, amplitude: 0.28 });import { draw } from "./assets/voxel";
import { armaPistola } from "./assets/arma-pistola";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, armaPistola, 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 arma-pistola
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["arma-pistola"] })
# Queda en client/assets/arma-pistola.ts
# https://fogon.page/object/arma-pistola