← ArmasObjeto 3Dfogon/arma-dos-pistolas
Dos pistolas
Arrastrá para girarlo// «Dos pistolas» · propio
// Two golden pistols side by side, parallel, both pointing the same way.
const colors = () => {};
part("body");
const GOLD_HI = "#ffe98a";
const GOLD_LT = "#f7c948";
const GOLD = "#e0a82b";
const GOLD_DK = "#b57c17";
const GOLD_SH = "#83550e";
const GRIP_HI = "#7a5230";
const GRIP = "#563622";
const GRIP_DK = "#33200f";
const BORE = "#241606";
const BRASS = "#c9a227";
const BRASS_HI = "#f0d060";
const T = 7;
const GZ = [GOLD_SH, GOLD_SH, GOLD_DK, GOLD_DK, GOLD, GOLD, GOLD_LT];
const RZ = [GRIP_DK, GRIP_DK, GRIP_DK, GRIP, GRIP_HI, GRIP_HI, GRIP_HI];
function gfill(ox, oy, u0, u1, w0, w1, pal) {
for (let u = u0; u <= u1; u++) {
for (let w = w0; w <= w1; w++) {
for (let z = 0; z < T; z++) set(ox + w, oy + u, z, pal[z]);
}
}
}
function buildGun(ox, oy) {
// slide / barrel
gfill(ox, oy, 0, 18, 0, 4, GZ);
// frame beneath the slide
gfill(ox, oy, 3, 18, 5, 7, GZ);
// trigger guard: front post + bottom bar
gfill(ox, oy, 5, 6, 8, 12, GZ);
gfill(ox, oy, 5, 14, 11, 12, GZ);
// slanted grip
for (let w = 7; w <= 17; w++) {
const off = Math.floor((w - 7) * 0.5);
gfill(ox, oy, 12 + off, 18 + off, w, w, RZ);
}
// grip checkering on the side face
for (let w = 7; w <= 17; w++) {
const off = Math.floor((w - 7) * 0.5);
for (let u = 12 + off; u <= 18 + off; u++) {
if ((u + w) % 2 === 0) set(ox + w, oy + u, 6, GRIP_DK);
}
}
// front + rear sights
gfill(ox, oy, 1, 2, -1, -1, GZ);
gfill(ox, oy, 15, 16, -1, -1, GZ);
// muzzle bore
for (let u = 0; u <= 1; u++)
for (let w = 1; w <= 3; w++)
for (let z = 2; z <= 4; z++) set(ox + w, oy + u, z, BORE);
// ejection port
for (let u = 8; u <= 12; u++)
for (let w = 1; w <= 3; w++) set(ox + w, oy + u, 6, "#8f6410");
// slide serrations
for (let u = 15; u <= 18; u++)
for (let w = 0; w <= 4; w++) set(ox + w, oy + u, 6, (w % 2 === 0) ? GOLD_DK : GOLD_HI);
// engraved line
for (let u = 4; u <= 7; u++) set(ox + 2, oy + u, 6, GOLD_HI);
// trigger blade
for (let w = 8; w <= 10; w++)
for (let z = 0; z < T; z++) set(ox + w, oy + 9 + Math.floor((w - 8) * 0.5), z, GOLD_DK);
}
buildGun(5, 12);
buildGun(27, 12);
// spent brass casings on the floor
box(23, 6, 0, 25, 7, 1, BRASS);
box(23, 6, 1, 25, 7, 1, BRASS_HI);
box(17, 7, 0, 19, 8, 1, BRASS);
box(17, 7, 1, 19, 8, 1, BRASS_HI);
// floating energy cores
function gem(cx, cy, cz) {
sphere(cx, cy, cz, 2.1, "#1f8fc4");
sphere(cx, cy, cz, 1.6, "#5fe0ff");
sphere(cx, cy, cz, 0.9, "#c8f7ff");
}
part("gemA", [13, 24, 10]);
gem(13, 24, 10);
colors("gemA", { palette: ["#5fe0ff", "#a8f0ff", "#2fb8e8", "#e8ffff"], pattern: "pulse", speed: 1.3, glow: 1 });
animate("gemA", { type: "bob", axis: "z", speed: 1.5, amplitude: 2 });
part("gemB", [35, 24, 10]);
gem(35, 24, 10);
colors("gemB", { palette: ["#5fe0ff", "#a8f0ff", "#2fb8e8", "#e8ffff"], pattern: "pulse", speed: 1.1, glow: 1 });
animate("gemB", { type: "bob", axis: "z", speed: 1.3, amplitude: 2 });import { draw } from "./assets/voxel";
import { armaDosPistolas } from "./assets/arma-dos-pistolas";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, armaDosPistolas, 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-dos-pistolas
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["arma-dos-pistolas"] })
# Queda en client/assets/arma-dos-pistolas.ts
# https://fogon.page/object/arma-dos-pistolas