← Level pieces 23D assetfogon/nivel-esquina-de-rampa
Esquina de rampa
Drag to turn it// «Esquina de rampa» · gpt-6-sol (medium)
// An outer corner piece for ramps: a full 48x48 footprint, a solid pyramid-like corner rising from z 0 along the front edge (y 0) AND the left edge (x 0) up to z 24 at the back-right corner (x 47, y 47), so it joins a ramp going up along y and one going up along x. Grass top in green stripes, brown dirt on the vertical faces.
// Outer corner ramp: the front and left edges start at floor level,
// while the back and right edges climb to the back-right corner.
for (let x = 0; x < 48; x++) {
for (let y = 0; y < 48; y++) {
const height = Math.floor(Math.min(x, y) * 24 / 47);
for (let z = 0; z < height; z++) {
const nearSurface = height - z <= 3;
let dirt = nearSurface ? "#a65d32" : "#ad6838";
// Clean horizontal bands make exposed dirt faces readable.
if (z % 7 === 0) dirt = "#96542f";
if (rand() < 0.035) dirt = "#bd7741";
set(x, y, z, dirt);
}
// Wide diagonal grass stripes across the sloping top.
const stripe = (x + y) % 14;
const grass = stripe < 5 ? "#80df48"
: stripe < 9 ? "#68cb38"
: "#57b92f";
set(x, y, height, grass);
}
}import { draw } from "./assets/voxel";
import { nivelEsquinaDeRampa } from "./assets/nivel-esquina-de-rampa";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelEsquinaDeRampa, 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-esquina-de-rampa
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-esquina-de-rampa"] })
# It lands in client/assets/nivel-esquina-de-rampa.ts
# https://fogon.page/object/nivel-esquina-de-rampa