← CiudadObjeto 3Dfogon/senal-de-velocidad
Señal de velocidad máxima
Arrastrá para girarlo// «Señal de velocidad máxima» · gpt-6-sol (medium)
// A speed limit sign on a thin grey metal post: a round white disc facing front (-y) with a thick red ring and the big black number 40 in the middle. The post stands on the ground and the disc sits at the top, about 34 blocks high in total.
// A toy-sized street sign, facing -y.
const cx = 24, cz = 22;
// Small concrete footing and thin metal post.
box(22, 22, 0, 26, 26, 1, "#b9bfc0");
box(23, 23, 2, 25, 25, 22, "#858f91");
box(23, 22, 2, 25, 22, 22, "#aeb7b8");
box(24, 22, 2, 24, 22, 21, "#c5ccca");
// Solid round disc, with a darker red edge and a white front.
for (let x = 12; x <= 36; x++) {
for (let z = 10; z <= 34; z++) {
const d2 = (x - cx) ** 2 + (z - cz) ** 2;
if (d2 > 144) continue;
for (let y = 21; y <= 24; y++) {
set(x, y, z, y === 24 ? "#a92f32" : "#d94343");
}
if (d2 <= 81) {
const white = z > 26 ? "#fffefa"
: z < 16 ? "#e7e8e3"
: rand() < 0.08 ? "#eeeeea" : "#f7f7f2";
set(x, 20, z, white);
} else {
set(x, 20, z, z > 27 ? "#f2645b" : z < 16 ? "#bc3339" : "#e44946");
}
}
}
// Chunky black numerals, one block in front of the white face.
const ink = "#202426";
function stroke(x0, z0, x1, z1) {
box(x0, 19, z0, x1, 19, z1, ink);
}
// 4
stroke(18, 23, 19, 27);
stroke(17, 21, 18, 24);
stroke(17, 20, 23, 21);
stroke(22, 16, 23, 27);
// 0
stroke(27, 26, 30, 27);
stroke(26, 19, 27, 25);
stroke(30, 19, 31, 25);
stroke(27, 17, 30, 18);
set(27, 19, 19, ink);
set(30, 19, 19, ink);import { draw } from "./assets/voxel";
import { senalDeVelocidad } from "./assets/senal-de-velocidad";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, senalDeVelocidad, 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 senal-de-velocidad
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["senal-de-velocidad"] })
# Queda en client/assets/senal-de-velocidad.ts
# https://fogon.page/object/senal-de-velocidad