← Level pieces 23D assetfogon/nivel-rampa-de-piedra
Rampa de piedra
Drag to turn it// «Rampa de piedra» · gpt-6-sol (medium)
// A modular stone ramp: a full 48x48 footprint (x 0..47, y 0..47), a solid wedge rising smoothly from z 0 at the front edge (y 0) to z 24 at the back edge (y 47), full 48 wide on x, filled solid underneath with flat vertical sides showing the triangular profile. The slope is light grey stone slabs in rows across x with darker seams; the sides are grey stone bricks with mortar lines.
const stone = "#aeb7bf";
const sideLight = "#a5afb8";
const sideDark = "#929da7";
const mortar = "#7d8993";
for (let y = 0; y < 48; y++) {
const height = Math.round(24 * y / 47);
for (let x = 0; x < 48; x++) {
for (let z = 0; z <= height; z++) {
let color = stone;
if (z === height) {
// Wide stone slabs follow the slope in rows across the ramp.
const row = Math.floor(y / 6);
const slabX = (x + (row % 2) * 6) % 12;
color = "#d9e0e4";
if (y % 6 === 0 || slabX === 0) color = "#aeb9c1";
else if (y % 6 === 1 || slabX === 1) color = "#e6eaeb";
else if (rand() < 0.018) color = "#cbd4da";
} else if (x === 0 || x === 47 || y === 47) {
// Exposed vertical faces: staggered bricks and crisp mortar joints.
const course = Math.floor(z / 5);
const along = y === 47 ? x : y;
const joint = (along + (course % 2) * 5) % 10 === 0;
color = course % 2 === 0 ? sideLight : stone;
if (z % 5 === 0 || joint) color = mortar;
else if (z % 5 === 4) color = "#bec7cd";
else if (rand() < 0.012) color = sideDark;
}
set(x, y, z, color);
}
}
}import { draw } from "./assets/voxel";
import { nivelRampaDePiedra } from "./assets/nivel-rampa-de-piedra";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelRampaDePiedra, 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-rampa-de-piedra
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-rampa-de-piedra"] })
# It lands in client/assets/nivel-rampa-de-piedra.ts
# https://fogon.page/object/nivel-rampa-de-piedra