← Level kit3D assetfogon/nivel-rampa
Rampa
Drag to turn it// «Rampa» · gpt-6-sol (medium)
// A modular 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), the full 48 wide on x, filled solid underneath, with vertical flat side faces showing the triangular profile. The sloped top is green grass with a few lighter stripes running across (along x) for grip; the side faces are brown dirt with a stone layer at the bottom; the back face is a flat vertical wall of dirt.
// Full-width modular grass ramp: 48 × 48, rising from z=0 to z=24.
const stone = ["#aeb7b8", "#bcc4c2", "#9da9ab"];
const dirt = ["#aa6539", "#b87343", "#985631"];
const grass = ["#43c747", "#4dce50", "#39b943"];
const grip = ["#82df69", "#91e777"];
for (let y = 0; y < 48; y++) {
const height = Math.round(24 * y / 47);
const stripe = [10, 11, 22, 23, 34, 35, 44, 45].includes(y);
for (let x = 0; x < 48; x++) {
for (let z = 0; z <= height; z++) {
let color;
if (z === height) {
// Continuous grassy slope, with crosswise grip stripes.
color = stripe ? grip[(x + y) % 2] : grass[1];
if (!stripe && rand() < 0.045) color = grass[rand() < 0.5 ? 0 : 2];
} else if (z <= 2) {
// A level stone foundation visible around the lower edges.
color = stone[0];
if ((x === 0 || x === 47 || y === 47) && rand() < 0.09)
color = stone[rand() < 0.5 ? 1 : 2];
} else {
color = dirt[0];
// Restrained speckling on the exposed triangular sides and back wall.
if ((x === 0 || x === 47 || y === 47) && rand() < 0.07)
color = dirt[rand() < 0.5 ? 1 : 2];
}
set(x, y, z, color);
}
}
}import { draw } from "./assets/voxel";
import { nivelRampa } from "./assets/nivel-rampa";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, nivelRampa, 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
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["nivel-rampa"] })
# It lands in client/assets/nivel-rampa.ts
# https://fogon.page/object/nivel-rampa