← CiudadObjeto 3Dfogon/tobogan
Tobogán
Arrastrá para girarlo// «Tobogán» · gpt-6-sol (medium)
// A playground slide: a ladder with blue rails climbing up to a small platform with side railings, and a wide bright yellow slide curving down toward the front (-y) to the ground. Chunky and colorful.
// Chunky playground slide, facing the viewer (-y).
const blue = "#168bd1";
const blueLight = "#42b8ee";
const blueDark = "#12649e";
const yellow = "#ffd629";
const yellowLight = "#ffe65b";
const yellowDark = "#eaa719";
// Concrete feet and four sturdy platform posts.
for (const x of [15, 33]) {
for (const y of [32, 37]) {
box(x - 2, y - 2, 0, x + 2, y + 2, 1, "#c5c7be");
box(x - 1, y - 1, 2, x + 1, y + 1, 22, blueDark);
box(x - 1, y - 1, 19, x + 1, y + 1, 22, blue);
box(x - 1, y - 1, 2, x - 1, y + 1, 18, blueLight);
}
}
// Small raised landing, with a warm brick-colored front fascia.
box(12, 30, 22, 36, 39, 23, blueDark);
box(13, 30, 24, 35, 38, 24, "#55c7dd");
box(13, 30, 22, 35, 30, 23, "#bf6951");
for (let x = 14; x <= 34; x += 4) {
box(x, 30, 22, x + 1, 30, 22, "#e89468");
}
for (let y = 31; y <= 38; y++) {
for (let x = 14; x <= 34; x++) {
if (rand() < 0.12) set(x, y, 24, "#83d9e1");
}
}
// Curved, broad yellow chute. Its slope flattens toward the ground.
function slideHeight(y) {
const t = (y - 5) / 25;
return Math.round(2 + 22 * t * t * (1.45 - 0.45 * t));
}
for (let y = 5; y <= 30; y++) {
const z = slideHeight(y);
box(14, y, Math.max(0, z - 2), 34, y, z - 1, yellowDark);
for (let x = 16; x <= 32; x++) {
const color = (x <= 18 || rand() < 0.09) ? yellowLight : yellow;
set(x, y, z, color);
}
// Thick, rounded-looking raised sides keep the slide's silhouette clear.
const wallTop = z + (y > 23 ? 3 : 2);
box(13, y, z - 1, 15, y, wallTop - 1, "#f2b31b");
box(33, y, z - 1, 35, y, wallTop - 1, yellowDark);
box(13, y, wallTop, 15, y, wallTop, yellowLight);
box(33, y, wallTop, 35, y, wallTop, yellowLight);
set(13, y, wallTop - 1, "#e88d16");
set(35, y, wallTop - 1, "#e88d16");
}
// A wide, gently flared exit at ground level.
box(15, 4, 1, 33, 5, 2, yellow);
box(15, 4, 2, 33, 4, 2, yellowLight);
// Supports beneath the chute.
for (const y of [13, 21]) {
const z = slideHeight(y);
for (const x of [17, 31]) {
box(x - 1, y - 1, 0, x + 1, y + 1, Math.max(1, z - 3), blueDark);
box(x - 1, y - 1, 0, x + 1, y + 1, 1, "#b7bbb5");
box(x - 1, y - 1, Math.max(2, z - 5), x - 1, y + 1, z - 3, blue);
}
}
// Tall blue guardrails on both sides of the landing.
for (const x of [12, 36]) {
for (const y of [31, 38]) {
box(x - 1, y - 1, 24, x + 1, y + 1, 30, blue);
box(x - 1, y - 1, 30, x + 1, y + 1, 31, blueLight);
}
box(x, 31, 28, x, 38, 29, blueDark);
box(x, 31, 31, x, 38, 31, blueLight);
for (const y of [33, 36]) {
set(x, y, 29, "#ffcf48");
}
}
// Rear railing leaves a central opening for the ladder.
for (const [a, b] of [[13, 17], [31, 35]]) {
box(a, 39, 27, b, 39, 28, blueDark);
box(a, 39, 31, b, 39, 31, blueLight);
}
// Steep ladder behind the platform, with broad visible rungs.
for (const x of [18, 30]) {
line(x, 45, 1, x, 39, 25, 1.3, blue);
line(x - 1, 45, 2, x - 1, 39, 25, 0, blueLight);
box(x - 2, 43, 0, x + 2, 46, 1, "#bec4bd");
}
for (let z = 3; z <= 21; z += 3) {
const y = Math.round(45 - (z - 1) * 6 / 24);
box(19, y, z, 29, y + 1, z + 1, blueDark);
box(20, y, z + 1, 28, y, z + 1, "#65ccec");
set(23, y, z + 1, "#ffdc48");
set(25, y, z + 1, "#ffdc48");
}
// Handholds extend above the ladder's last step.
for (const x of [18, 30]) {
box(x - 1, 39, 24, x + 1, 39, 28, blue);
box(x - 1, 39, 28, x + 1, 39, 29, blueLight);
}import { draw } from "./assets/voxel";
import { tobogan } from "./assets/tobogan";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, tobogan, 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 tobogan
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["tobogan"] })
# Queda en client/assets/tobogan.ts
# https://fogon.page/object/tobogan