← Piezas de nivel 2Objeto 3Dfogon/nivel-rampa-de-piedra
Rampa de piedra
Arrastrá para girarlo// «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";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelRampaDePiedra, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: lo que mide en px su lado más largo
// angle: giro sobre el piso, en radianes
// t: segundos; si se mueve, se anima solo con eso# En una terminal, en la carpeta del juego
fogon assets add nivel-rampa-de-piedra
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-rampa-de-piedra"] })
# Queda en client/assets/nivel-rampa-de-piedra.ts
# https://fogon.page/object/nivel-rampa-de-piedra