← EquipamientoObjeto 3Dfogon/pergamino
Pergamino
Arrastrá para girarlo// «Pergamino» · gpt-6-sol (medium)
// A magic scroll lying on the floor, partly unrolled: cream parchment with wooden rod handles at both ends, a few lines of dark red runes and a glowing golden seal in the middle.
const wood = "#85502e";
const woodLight = "#a96d3b";
const woodDark = "#65391f";
const brass = "#bc8739";
const brassLight = "#efc66b";
const parchment = "#f0dfb4";
const ink = "#873a36";
// Wooden rods at the rolled ends of the scroll.
for (const y of [9, 39]) {
cylinder(3, y, 3, 3, 42, wood, "x");
// Grain and highlights along the exposed upper face.
for (let x = 7; x <= 40; x++) {
if (x % 9 !== 0) {
set(x, y - 1, 6, rand() < 0.22 ? wood : woodLight);
}
if (x % 7 < 4) set(x, y - 2, 5, woodDark);
}
// Chunky end caps and brass collars.
cylinder(3, y, 3, 3.4, 3, woodDark, "x");
cylinder(42, y, 3, 3.4, 3, woodDark, "x");
cylinder(6, y, 3, 3.3, 2, brass, "x");
cylinder(40, y, 3, 3.3, 2, brass, "x");
for (const x of [6, 40]) {
set(x, y, 7, brassLight);
set(x, y - 2, 6, brassLight);
}
}
// Thick, gently uneven parchment between the rolls.
for (let x = 8; x <= 39; x++) {
for (let y = 12; y <= 36; y++) {
const edge = x === 8 || x === 39 || y === 12 || y === 36;
const shade = edge ? "#d5bb89"
: rand() < 0.075 ? "#e7d0a0"
: rand() < 0.045 ? "#fff0ca"
: parchment;
for (let z = 2; z <= 4; z++) {
set(x, y, z, z === 2 ? "#c9ad7d" : shade);
}
}
}
// Raised curls where the parchment meets each rod.
for (let x = 8; x <= 39; x++) {
for (const y of [12, 13, 35, 36]) {
set(x, y, 5, y === 12 || y === 36 ? "#d5bb89" : "#fff0ca");
}
}
// Fine decorative border, inset from the worn edges.
for (let x = 10; x <= 37; x++) {
set(x, 14, 5, "#bc8955");
set(x, 34, 5, "#bc8955");
}
for (let y = 15; y <= 33; y++) {
set(10, y, 5, "#bc8955");
set(37, y, 5, "#bc8955");
}
// Two rows of bold, angular red runes.
const glyphs = [
["101", "111", "010", "101"],
["110", "101", "110", "101"],
["010", "101", "111", "010"],
["101", "011", "110", "101"],
["111", "010", "101", "110"],
["011", "110", "011", "101"]
];
for (const [row, order] of [[16, [0, 2, 1, 4, 3, 5]], [29, [3, 5, 0, 2, 4, 1]]]) {
order.forEach((index, i) => {
const glyph = glyphs[index];
for (let dy = 0; dy < 4; dy++) {
for (let dx = 0; dx < 3; dx++) {
if (glyph[dy][dx] === "1") {
set(11 + i * 5 + dx, row + dy, 5,
(dx + dy) % 5 === 0 ? "#a54c43" : ink);
}
}
}
});
}
// Small flourishes on either side of the seal.
for (const y of [23, 25]) {
line(12, y, 5, 17, y, 5, 0, ink);
line(31, y, 5, 35, y, 5, 0, ink);
}
set(14, 22, 5, ink);
set(33, 26, 5, ink);
// The raised, softly glowing magical seal is its own part.
part("golden seal", [24, 24, 6]);
for (let dx = -6; dx <= 6; dx++) {
for (let dy = -6; dy <= 6; dy++) {
const d = Math.sqrt(dx * dx + dy * dy);
if (d <= 5.4) {
set(24 + dx, 24 + dy, 5, "#b77825");
if (d <= 4.7) set(24 + dx, 24 + dy, 6, "#efb83e");
if (d >= 3.5 && d <= 5.1) {
set(24 + dx, 24 + dy, 7, "#ffd76c");
} else if (d <= 2.9) {
set(24 + dx, 24 + dy, 7, "#d8992c");
}
}
}
}
// A chunky four-point star embossed in the center.
line(24, 21, 8, 24, 27, 8, 0, "#ffe589");
line(21, 24, 8, 27, 24, 8, 0, "#ffe589");
for (const [dx, dy] of [[-6, 0], [6, 0], [0, -6], [0, 6]]) {
set(24 + dx, 24 + dy, 6, "#ffe589");
}
set(24, 24, 9, "#fff0a8");
animate("golden seal", {
type: "colors",
palette: ["#b87927", "#e6ac38", "#ffd66a", "#fff0a3"],
pattern: "pulse",
glow: 0.6
});import { draw } from "./assets/voxel";
import { pergamino } from "./assets/pergamino";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, pergamino, 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 pergamino
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["pergamino"] })
# Queda en client/assets/pergamino.ts
# https://fogon.page/object/pergamino