← BásicoObjeto 3Dfogon/pico
Pico
Arrastrá para girarlo// «Pico» · gpt-6-sol (medium)
// Pickaxe («Pico»).
// Wooden handle, leaning slightly toward the head.
for (let z = 0; z <= 39; z++) {
const c = Math.round(19 + z * 0.14);
const grip = z >= 2 && z <= 14;
const half = grip ? 3 : 2;
const front = grip ? 19 : 20;
const back = grip ? 26 : 25;
for (let x = c - half; x <= c + half; x++) {
for (let y = front; y <= back; y++) {
let color;
if (grip) {
color = x === c - half || y === back ? "#39271d"
: y === front ? "#65432b" : "#503320";
if (rand() < 0.13) color = "#795033";
} else {
color = x === c - half || y === back ? "#75451f"
: y === front ? "#b97c38" : "#98602b";
if (rand() < 0.11) color = "#d19a52";
}
set(x, y, z, color);
}
}
// Uneven bright grain on the visible face.
if (!grip && z > 15 && z < 37) {
set(c - 1, 19, z, z % 6 < 3 ? "#ca8c42" : "#aa6c30");
if (z % 7 === 0 || z % 7 === 1) set(c + 1, 19, z, "#e0aa61");
}
}
// Dark, worn leather wrapping and its staggered seams.
for (let z = 3; z <= 13; z += 3) {
const c = Math.round(19 + z * 0.14);
box(c - 3, 18, z, c + 2, 18, z, "#3d291d");
set(c - 2 + (z % 2), 17, z + 1, "#91633b");
set(c + 1, 18, z + 2, "#704a2d");
}
box(18, 20, 0, 21, 25, 1, "#a97236");
box(19, 19, 0, 20, 20, 0, "#d09a51");
box(18, 19, 2, 22, 25, 3, "#4d3020");
// Small irregular marks in the exposed wood.
for (let z = 17; z <= 35; z += 5) {
const c = Math.round(19 + z * 0.14);
set(c + 2, 19, z, "#69401f");
set(c - 1, 18, z + 1, "#e0a358");
}
// Forged steel head: a long, descending left point and a shorter right point.
for (let x = 2; x <= 46; x++) {
let top, bottom;
if (x < 20) {
top = Math.round(28 + (x - 2) * 0.84);
bottom = top - Math.min(5, Math.floor((x - 2) / 4) + 1);
} else if (x <= 29) {
top = x >= 22 && x <= 27 ? 44 : 43;
bottom = 38;
} else {
top = 44 - Math.round((x - 29) * 0.49);
bottom = top - Math.min(5, 1 + Math.floor((46 - x) / 4));
}
const front = x < 8 ? 22 : x < 18 ? 20 : x <= 30 ? 18 : x > 42 ? 23 : 21;
const back = x < 8 || x > 43 ? 25 : x < 18 || x > 35 ? 26 : 28;
for (let z = bottom; z <= top; z++) {
for (let y = front; y <= back; y++) {
let color = "#778e98";
if (z === bottom) color = "#4b636d";
else if (z === top) color = "#b2c2c5";
else if (y === front) color = "#839aa3";
else if (y === back) color = "#617983";
if (rand() < 0.07 && z > bottom && z < top) color = "#9dafb5";
set(x, y, z, color);
}
}
}
// Raised, stepped bevel along the upper edge of the long point.
for (let x = 8; x <= 20; x += 2) {
const z = x < 20 ? Math.round(28 + (x - 2) * 0.84) : 43;
set(x, 19, z, "#c5cdd0");
set(x + 1, 19, z - 1, "#9db2ba");
set(x, 20, z - 2, "#526d78");
}
for (let x = 31; x <= 43; x += 3) {
const z = 44 - Math.round((x - 29) * 0.49);
set(x, 20, z, "#b7c6c8");
set(x + 1, 21, z - 1, "#869da4");
}
// Squared socket and its broad, pale front face.
box(20, 17, 39, 21, 18, 43, "#526b76");
box(22, 17, 39, 27, 17, 43, "#879fa8");
box(23, 16, 41, 26, 16, 43, "#a9bbc0");
box(22, 16, 39, 22, 16, 42, "#69828d");
box(27, 16, 39, 27, 16, 42, "#607985");
box(28, 18, 39, 29, 19, 43, "#506a75");
box(21, 19, 38, 28, 25, 38, "#405863");
box(23, 16, 43, 26, 19, 43, "#c1cbcc");
// The little wooden end visible above the steel socket.
box(22, 21, 44, 25, 25, 45, "#83562b");
box(23, 21, 45, 25, 24, 46, "#b7803e");
box(23, 20, 45, 24, 20, 46, "#d8a35c");
set(22, 20, 44, "#4c6069");
set(26, 21, 44, "#4c6069");import { draw } from "./assets/voxel";
import { pico } from "./assets/pico";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, pico, 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 pico
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["pico"] })
# Queda en client/assets/pico.ts
# https://fogon.page/object/pico