← Weapons3D assetfogon/arma-cuchillo
Cuchillo
Drag to turn it// «Cuchillo» · propio
// A combat knife: shiny steel blade with a sharp tip and a black grip with a guard.
const colors = () => {};
// ---------- palette ----------
const EDGE = "#f8fcff";
const LIGHT = "#dde6ef";
const MID = "#b0bcc9";
const DARK = "#7c8896";
const DEEP = "#5b6572";
const FULLER = "#98a5b2";
const G_BLACK = "#141519";
const G_DARK = "#23262c";
const G_MID = "#34383f";
const G_LIGHT = "#4a4f58";
const GRD_MID = "#5f6a77";
const GRD_TOP = "#93a0ae";
const GRD_BOT = "#3f4750";
const P_MID = "#5c6673";
const P_TOP = "#8894a2";
const BRASS = "#c9a83f";
// ---------- BLADE ----------
part("blade");
for (let x = 20; x <= 43; x++) {
const f = (x - 20) / 23;
const spine = 29 - Math.round(5 * Math.pow(Math.max(0, (f - 0.6) / 0.4), 1.5));
const edge = 19 + Math.round(5 * Math.pow(f, 1.3));
for (let y = edge; y <= spine; y++) {
if (y === edge) {
set(x, y, 0, DARK);
set(x, y, 1, MID);
set(x, y, 2, EDGE);
set(x, y, 3, EDGE);
} else if (y === spine) {
set(x, y, 0, DEEP);
set(x, y, 1, DARK);
set(x, y, 2, MID);
set(x, y, 3, DARK);
} else {
set(x, y, 0, DEEP);
set(x, y, 1, MID);
set(x, y, 2, LIGHT);
set(x, y, 3, LIGHT);
}
}
if (x >= 22 && x <= 34) {
set(x, 25, 3, FULLER);
}
}
// sharp tip
set(44, 24, 0, MID);
set(44, 24, 1, LIGHT);
set(44, 24, 2, EDGE);
set(44, 24, 3, EDGE);
// ---------- GUARD ----------
part("body");
for (let y = 17; y <= 31; y++) {
const d = Math.abs(y - 24);
const zTop = d >= 6 ? 2 : 4;
const zBot = d >= 6 ? 1 : 0;
for (let z = zBot; z <= zTop; z++) {
let c = GRD_MID;
if (z === zTop) c = GRD_TOP;
else if (z === zBot) c = GRD_BOT;
for (let x = 17; x <= 19; x++) set(x, y, z, c);
}
}
// ---------- HANDLE ----------
for (let x = 5; x <= 16; x++) {
const cap = (x === 5 || x === 16);
const band = (x === 8 || x === 12);
for (let y = 20; y <= 28; y++) {
const side = (y === 20 || y === 28);
const zBot = (cap || side) ? 1 : 0;
const zTop = (cap || side) ? 3 : 4;
for (let z = zBot; z <= zTop; z++) {
let c = G_DARK;
if (z === 4) c = G_LIGHT;
if (z === 0) c = G_BLACK;
if (band) c = (z === 4) ? G_MID : G_BLACK;
set(x, y, z, c);
}
}
}
// brass grip pins
set(9, 24, 4, BRASS);
set(13, 24, 4, BRASS);
set(9, 20, 2, BRASS);
set(9, 28, 2, BRASS);
set(13, 20, 2, BRASS);
set(13, 28, 2, BRASS);
// ---------- POMMEL ----------
for (let x = 3; x <= 4; x++) {
for (let y = 21; y <= 27; y++) {
const side = (y === 21 || y === 27);
const zBot = side ? 1 : 0;
const zTop = side ? 3 : 4;
for (let z = zBot; z <= zTop; z++) {
set(x, y, z, (z === zTop) ? P_TOP : P_MID);
}
}
}
// ---------- GLINT (sparkle above the blade) ----------
part("glint");
set(34, 25, 5, "#ffffff");
set(33, 25, 5, "#dcefff");
set(35, 25, 5, "#dcefff");
set(34, 24, 5, "#dcefff");
set(34, 26, 5, "#dcefff");
set(34, 25, 6, "#ffffff");
// ---------- ANIMATION ----------
colors("blade", {
palette: [MID, LIGHT, EDGE],
pattern: "flicker",
speed: 0.9,
glow: 0.12
});
void ("glint", { type: "bob", axis: "z", speed: 2.0, amplitude: 1.2 });
colors("glint", {
palette: ["#ffffff", "#cfe6ff", "#8fb8ff"],
pattern: "flicker",
speed: 3.0,
glow: 1.0
});import { draw } from "./assets/voxel";
import { armaCuchillo } from "./assets/arma-cuchillo";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, armaCuchillo, 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-cuchillo
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["arma-cuchillo"] })
# It lands in client/assets/arma-cuchillo.ts
# https://fogon.page/object/arma-cuchillo