← Level pieces 23D assetfogon/nivel-muralla-de-castillo
Muralla de castillo
Drag to turn it// «Muralla de castillo» · gpt-6-sol (medium)
// A modular wall segment: exactly 48 blocks long on x (x 0..47), 10 thick on y (y 19..28), 44 tall, with flat clean ends so segments join seamlessly. Dark slate-blue grey stone bricks in 3 shades with recessed mortar; in the middle an arrow slit (a 2x10 dark opening) on the front; along the top a walkway edge with crenellations (8-wide merlons 6 tall, 4-wide gaps); a red banner with a gold emblem hangs on the front face to the left of the slit.
const mortar = "#344656";
const stone = ["#526a7d", "#5b7386", "#647d90"];
const stoneLight = "#7891a1";
const stoneDark = "#405467";
// Solid, grid-aligned wall: x 0..47, y 19..28, z 0..37.
box(0, 19, 0, 47, 28, 37, mortar);
box(0, 20, 0, 47, 27, 37, "#506579");
// Staggered brick courses on both long faces. One-block mortar joints
// stay recessed within the exact footprint.
for (let course = 0; course < 8; course++) {
const bottom = course * 5;
const offset = course % 2 ? 4 : 0;
for (let start = -offset; start < 48; start += 9) {
const shade = stone[(course + Math.floor((start + offset) / 9) + 30) % 3];
for (let x = Math.max(0, start); x <= Math.min(47, start + 7); x++) {
for (let z = bottom; z <= Math.min(37, bottom + 3); z++) {
const color = z === bottom ? stoneDark
: z === bottom + 3 ? stoneLight : shade;
set(x, 19, z, color);
set(x, 28, z, color);
}
}
}
}
// Flat, finished end faces.
for (const x of [0, 47]) {
for (let y = 20; y <= 27; y++) {
for (let z = 0; z <= 37; z++) {
set(x, y, z, z % 5 === 4 ? mortar
: z % 5 === 3 ? stoneLight : "#586f82");
}
}
}
// Walkway, with pale paving joints.
box(0, 21, 38, 47, 26, 38, "#738b9b");
for (let x = 0; x < 48; x++) {
for (let y = 21; y <= 26; y++) {
if (x % 8 === 7 || y === 24) set(x, y, 38, "#536a7b");
}
}
// Four 8-wide merlons, separated by 4-wide gaps. The gap straddles
// each segment boundary, so the pattern continues when walls join.
for (let start = 2; start < 48; start += 12) {
for (const [front, back] of [[19, 20], [27, 28]]) {
box(start, front, 38, start + 7, back, 43, "#536b7e");
box(start, front, 43, start + 7, back, 43, stoneLight);
for (let x = start; x <= start + 7; x++) {
set(x, front, 38, stoneDark);
set(x, front, 42, "#647e91");
if (x === start || x === start + 7) {
for (let z = 38; z <= 42; z++) set(x, front, z, mortar);
}
}
}
}
// A narrow, ten-block-high arrow slit, recessed into a dark cavity.
box(23, 19, 16, 24, 21, 25, null);
box(23, 22, 16, 24, 22, 25, "#172533");
for (let z = 16; z <= 25; z++) {
set(22, 19, z, stoneLight);
set(25, 19, z, stoneDark);
}
for (let x = 22; x <= 25; x++) {
set(x, 19, 26, stoneLight);
set(x, 19, 15, stoneDark);
}
// Flush-mounted red banner, left of the slit.
box(9, 19, 19, 16, 19, 32, "#b82e40");
box(10, 19, 19, 15, 19, 31, "#d83b4b");
box(10, 19, 17, 15, 19, 18, "#b82e40");
box(11, 19, 16, 14, 19, 16, "#b82e40");
box(12, 19, 15, 13, 19, 15, "#a8273b");
for (let z = 20; z <= 31; z++) {
set(10, 19, z, "#ee5360");
set(15, 19, z, "#a8273b");
}
box(8, 19, 33, 17, 19, 33, "#e7aa3e");
box(9, 19, 32, 16, 19, 32, "#ffcf62");
set(8, 19, 33, "#fff09b");
set(17, 19, 33, "#fff09b");
// Chunky gold four-point crest.
for (let z = 22; z <= 29; z++) {
const width = z === 25 || z === 26 ? 3
: z === 24 || z === 27 ? 2 : 1;
for (let x = 12 - Math.floor((width - 1) / 2); x <= 12 + Math.ceil((width - 1) / 2); x++) {
set(x, 19, z, z >= 27 ? "#ffe17a" : "#f5b940");
}
}
box(10, 19, 25, 15, 19, 26, "#ffd269");
box(12, 19, 24, 13, 19, 27, "#fff09b");import { draw } from "./assets/voxel";
import { nivelMurallaDeCastillo } from "./assets/nivel-muralla-de-castillo";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelMurallaDeCastillo, 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 nivel-muralla-de-castillo
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-muralla-de-castillo"] })
# It lands in client/assets/nivel-muralla-de-castillo.ts
# https://fogon.page/object/nivel-muralla-de-castillo