← Medieval3D assetfogon/empalizada
Empalizada
Drag to turn it// «Empalizada» · gpt-6-sol (medium)
// A straight section of wooden palisade fence spanning the whole width (x 0..47): a row of tall vertical sharpened logs (pointed tops, brown bark with lighter cut tips) tied together with two horizontal rope bands, held by diagonal wooden props at the back, standing on a strip of dirt.
// Dirt footing
box(0, 14, 0, 47, 34, 1, "#755136");
box(0, 15, 2, 47, 33, 2, "#91643e");
for (let x = 0; x < 48; x++) {
for (let y = 14; y <= 34; y++) {
if (rand() < 0.13) set(x, y, 2, rand() < 0.5 ? "#a57648" : "#65492f");
if (rand() < 0.025) set(x, y, 3, "#5b6840");
}
}
for (let x = 0; x < 48; x++) {
if (rand() < 0.27) set(x, 14, 1, "#ab784e");
}
// Rear rails and sturdy diagonal braces
for (const z of [11, 24]) {
box(1, 22, z, 46, 24, z + 2, "#493122");
box(1, 22, z + 2, 46, 22, z + 2, "#745036");
}
for (const x of [5, 18, 31, 43]) {
line(x + 2, 31, 3, x, 22, 26, 1.6, "#513522");
line(x + 1, 30, 4, x - 1, 22, 25, 0, "#986946");
box(x - 1, 29, 2, x + 3, 32, 4, "#4d3729");
box(x, 30, 4, x + 2, 31, 4, "#98704b");
}
// Twelve individually hewn, closely set palisade stakes
for (let i = 0; i < 12; i++) {
const x0 = i * 4;
const front = (i % 5 === 2) ? 18 : 17;
const top = 38 + ([0, 1, 0, -1, 0, 1][i % 6]);
for (let x = x0; x < x0 + 4; x++) {
for (let y = front; y <= 21; y++) {
for (let z = 3; z <= top; z++) {
const tip = z - (top - 5);
if (tip > 0) {
if (tip >= 5 && (x !== x0 + 1 || y !== front + 2)) continue;
if (tip === 4 && (x < x0 + 1 || x > x0 + 2 || y !== front + 2)) continue;
if (tip === 3 && (x < x0 + 1 || x > x0 + 2 || y < front + 1 || y > front + 3)) continue;
if (tip === 2 && (y === front || y === 21)) continue;
}
let color;
if (tip > 0) {
color = tip >= 4 ? "#ead0a1" : tip >= 2 ? "#d9b37a" : "#bd8958";
if (x === x0) color = "#a8794f";
} else {
color = x === x0 ? "#533723" :
x === x0 + 3 ? "#705036" :
y === front ? "#91633e" : "#70492e";
if (y === 21) color = "#493422";
if (rand() < 0.045) color = "#a47147";
if (rand() < 0.035) color = "#513822";
}
set(x, y, z, color);
}
}
}
// Long, restrained bark grain on the visible face
for (const gx of [x0 + 1, x0 + 3]) {
for (let z = 5 + (i % 3); z < 32; z += 7) {
line(gx, front - 1, z, gx, front - 1, z + 2 + (i % 2),
0, gx === x0 + 1 ? "#aa754a" : "#563923");
}
}
set(x0 + 2, front - 1, 29 + (i % 3), "#b88455");
}
// Two thick, braided rope lashings across the front of every stake
for (const z of [13, 25]) {
box(0, 16, z, 47, 16, z + 1, "#795330");
box(0, 15, z + 1, 47, 15, z + 1, "#c69b5c");
for (let x = 0; x < 48; x++) {
set(x, 15, z, x % 4 < 2 ? "#a97943" : "#dfb875");
set(x, 15, z + 1, x % 4 < 2 ? "#d8ad69" : "#a67743");
}
// Knotted loops that visibly cinch the rope to the logs
for (let i = 0; i < 12; i++) {
const x = i * 4 + 2;
set(x, 14, z, "#e0b66f");
set(x, 14, z + 1, "#af7d44");
set(x - 1, 15, z + 2, "#d0a05c");
if (i % 3 === 1) {
set(x, 14, z - 1, "#bc8b4c");
set(x, 14, z - 2, "#956939");
}
}
}import { draw } from "./assets/voxel";
import { empalizada } from "./assets/empalizada";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, empalizada, 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 empalizada
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["empalizada"] })
# It lands in client/assets/empalizada.ts
# https://fogon.page/object/empalizada