← Weapons3D assetfogon/arma-escopeta-doble
Escopeta doble
Drag to turn it// «Escopeta doble» · propio
// A double-barrel shotgun: two side-by-side dark barrels, a wooden stock with brass details.
const colors = () => {};
const WOOD = "#8a5a2b";
const WOOD_H = "#a9713a";
const WOOD_D = "#5f3c1c";
const STEEL = "#2e333b";
const STEEL_H = "#4b535f";
const STEEL_D = "#171a1f";
const BRASS = "#c9a227";
const BRASS_H = "#e8c85a";
const BRASS_D = "#8f6f18";
part("body");
// ---------------- STOCK (rear) ----------------
box(2,19,0,2,29,7, BRASS); // brass butt plate
box(2,20,1,2,28,6, BRASS_H);
box(3,19,0,8,29,7, WOOD); // butt
box(9,19,0,12,29,6, WOOD); // mid stock
box(13,20,0,14,28,5, WOOD); // wrist / grip
// brass pins on the stock
set(6,21,7, BRASS_H);
set(6,27,7, BRASS_H);
set(6,24,7, BRASS_D);
// ---------------- RECEIVER ----------------
box(15,18,0,18,30,6, STEEL);
box(15,18,6,18,30,6, STEEL_H); // top plate
box(15,23,6,18,25,6, BRASS); // top tang
set(16,19,5, BRASS); // side pins
set(16,29,5, BRASS);
// ---------------- BARRELS ----------------
cylinder(18,21,2.5,2.5,27, STEEL, "x");
cylinder(18,27,2.5,2.5,27, STEEL, "x");
// dark seam between the two barrels
box(18,23,0,44,25,5, STEEL_D);
// wooden fore-end sleeve
cylinder(22,21,2.5,2.9,11, WOOD, "x");
cylinder(22,27,2.5,2.9,11, WOOD, "x");
// brass band around the barrels
cylinder(34,21,2.5,3.0,2, BRASS, "x");
cylinder(34,27,2.5,3.0,2, BRASS, "x");
// top sighting rib
box(19,23,5,44,25,5, "#5b6472");
// ---------------- MUZZLE ----------------
cylinder(42,21,2.5,3.0,2, BRASS, "x");
cylinder(42,27,2.5,3.0,2, BRASS, "x");
cylinder(44,21,2.5,2.5,1, STEEL_D, "x");
cylinder(44,27,2.5,2.5,1, STEEL_D, "x");
cylinder(44,21,2.5,1.4,1, "#0b0d10", "x");
cylinder(44,27,2.5,1.4,1, "#0b0d10", "x");
// front sight bead
set(41,24,6, BRASS_H);
// ---------------- GRAIN / WEATHER PASS ----------------
forEach((x, y, z, c) => {
if (c === WOOD) {
const n = Math.sin(x * 1.9 + y * 2.7 + z * 0.7) * 0.5 + 0.5;
if (n > 0.74) set(x, y, z, WOOD_H);
else if (n < 0.18) set(x, y, z, WOOD_D);
} else if (c === STEEL) {
const n = Math.sin(x * 2.1 + y * 1.3 + z * 3.1) * 0.5 + 0.5;
if (n > 0.80) set(x, y, z, STEEL_H);
else if (n < 0.14) set(x, y, z, STEEL_D);
}
});
// ---------------- HAMMERS ----------------
part("hammerL", [15, 21, 6]);
box(15,20,6,16,22,8, STEEL_H);
set(15,21,8, BRASS);
set(16,20,8, STEEL_D);
set(15,20,7, STEEL_D);
part("hammerR", [15, 27, 6]);
box(15,26,6,16,28,8, STEEL_H);
set(15,27,8, BRASS);
set(16,26,8, STEEL_D);
set(15,26,7, STEEL_D);
part("body");
animate("hammerL", { type: "swing", axis: "y", speed: 2.0, amplitude: 0.45 });
animate("hammerR", { type: "swing", axis: "y", speed: 2.0, amplitude: 0.45 });import { draw } from "./assets/voxel";
import { armaEscopetaDoble } from "./assets/arma-escopeta-doble";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, armaEscopetaDoble, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: its longest side, in px
// angle: turn on the floor, in radians
// t: seconds; if it moves, that animates it# In a terminal, in the game's folder
fogon assets add arma-escopeta-doble
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["arma-escopeta-doble"] })
# It lands in client/assets/arma-escopeta-doble.ts
# https://fogon.page/object/arma-escopeta-doble