← CiudadObjeto 3Dfogon/escuela
Escuela
Arrastrá para girarlo// «Escuela» · gpt-6-sol (medium)
// A public primary school: a two-story building of warm brick and cream plaster with tall windows, a big central entrance with steps and double doors facing -y, a clock above the door, an Argentine flag on a pole on the roof, and a low fence in front.
const brick = "#b65c49";
const brickLight = "#c76b53";
const brickDark = "#9c483e";
const cream = "#f3dfb4";
const plaster = "#ead0a4";
const plasterShade = "#d6b98d";
const green = "#285b4d";
const greenLight = "#397365";
const glass = "#78bdd0";
const glassLight = "#b5e0e5";
const stone = "#b9b6a9";
// Pavement, foundation, and two-story building shell.
box(3, 0, 0, 44, 10, 0, "#a8a9a3");
box(3, 0, 0, 44, 2, 0, "#777e80");
box(5, 10, 1, 42, 40, 3, stone);
box(6, 11, 4, 41, 12, 31, brick);
box(6, 38, 4, 41, 39, 31, brick);
box(6, 13, 4, 7, 37, 31, brick);
box(40, 13, 4, 41, 37, 31, brick);
box(7, 13, 17, 40, 37, 18, brickDark);
box(6, 11, 31, 41, 39, 32, plasterShade);
// Subtle variation on visible brick.
forEach((x, y, z, color) => {
if (color !== brick) return;
if (y === 11 || x === 6 || x === 41) {
const n = rand();
if (n < 0.075) set(x, y, z, brickLight);
else if (n < 0.12) set(x, y, z, brickDark);
}
});
// Cream corner pilasters and horizontal floor bands.
for (const x of [6, 40]) {
box(x, 10, 4, x + 1, 12, 31, plaster);
for (let z = 5; z < 31; z += 5) box(x, 9, z, x + 1, 10, z, cream);
}
for (const z of [4, 14, 20, 31]) {
box(6, 9, z, 41, 11, z, cream);
box(6, 12, z, 7, 39, z, plasterShade);
box(40, 12, z, 41, 39, z, plasterShade);
}
// Central cream entrance bay.
box(19, 9, 4, 29, 11, 31, plaster);
box(19, 8, 4, 19, 10, 31, cream);
box(29, 8, 4, 29, 10, 31, cream);
box(19, 8, 30, 29, 10, 31, cream);
// Tall front windows, with chunky frames, sills, and divided blue panes.
function frontWindow(x0, x1, z0, z1) {
box(x0 - 1, 8, z0 - 1, x1 + 1, 11, z1 + 1, cream);
box(x0, 7, z0, x1, 9, z1, green);
box(x0 + 1, 6, z0 + 1, x1 - 1, 7, z1 - 1, glass);
box(x0 + 1, 5, z1 - 2, x1 - 1, 6, z1 - 1, glassLight);
const mid = Math.floor((x0 + x1) / 2);
box(mid, 5, z0, mid, 7, z1, greenLight);
box(x0, 5, Math.floor((z0 + z1) / 2), x1, 7,
Math.floor((z0 + z1) / 2), greenLight);
box(x0 - 1, 6, z0 - 2, x1 + 1, 9, z0 - 1, plasterShade);
}
for (const [a, b] of [[9, 14], [16, 18], [30, 32], [34, 39]]) {
frontWindow(a, b, 6, 12);
frontWindow(a, b, 23, 29);
}
// Windows along the visible side walls.
function sideWindow(x, ya, z0) {
box(x - 1, ya - 1, z0 - 1, x + 1, ya + 6, z0 + 7, cream);
box(x - 2, ya, z0, x - 1, ya + 5, z0 + 6, green);
box(x - 3, ya + 1, z0 + 1, x - 2, ya + 4, z0 + 5, glass);
box(x - 3, ya + 3, z0, x - 2, ya + 3, z0 + 6, greenLight);
box(x - 2, ya - 1, z0 - 2, x, ya + 6, z0 - 1, plasterShade);
}
for (const ya of [18, 30]) {
sideWindow(6, ya, 6);
sideWindow(6, ya, 23);
}
// Recessed double entrance doors and bright transom.
box(20, 8, 3, 28, 10, 14, cream);
box(21, 7, 3, 27, 8, 12, green);
box(21, 6, 5, 23, 7, 10, glass);
box(25, 6, 5, 27, 7, 10, glass);
box(24, 5, 3, 24, 8, 12, cream);
box(21, 6, 11, 27, 7, 12, glassLight);
set(23, 5, 6, "#e9b350");
set(25, 5, 6, "#e9b350");
box(19, 6, 13, 29, 10, 14, cream);
box(20, 5, 14, 28, 8, 14, plasterShade);
// Wide, shallow entrance steps.
box(18, 5, 0, 30, 10, 0, "#d6d1c3");
box(19, 7, 1, 29, 10, 1, "#e6dfcb");
box(20, 9, 2, 28, 10, 2, cream);
for (const yy of [5, 7, 9]) {
box(18 + (yy - 5) / 2, yy, (yy - 5) / 2,
30 - (yy - 5) / 2, yy, (yy - 5) / 2, "#f3ead7");
}
// School name on a cream plaque, rendered in chunky pixel lettering.
box(10, 7, 15, 38, 9, 21, cream);
box(10, 6, 15, 38, 6, 15, plasterShade);
const letters = {
E: ["111", "100", "110", "100", "111"],
S: ["111", "100", "111", "001", "111"],
C: ["111", "100", "100", "100", "111"],
U: ["101", "101", "101", "101", "111"],
L: ["100", "100", "100", "100", "111"],
A: ["111", "101", "111", "101", "101"]
};
"ESCUELA".split("").forEach((letter, i) => {
letters[letter].forEach((row, r) => {
for (let c = 0; c < 3; c++) {
if (row[c] === "1") set(11 + i * 4 + c, 5, 20 - r, green);
}
});
});
// Round clock above the entrance, with a golden rim and dark hands.
for (let dx = -4; dx <= 4; dx++) {
for (let dz = -4; dz <= 4; dz++) {
const d = dx * dx + dz * dz;
if (d <= 16) set(24 + dx, 7, 26 + dz, "#dbad58");
if (d <= 10) set(24 + dx, 6, 26 + dz, "#fff4d6");
}
}
for (const [dx, dz] of [[0, 3], [3, 0], [0, -3], [-3, 0]]) {
set(24 + dx, 5, 26 + dz, green);
}
line(24, 5, 26, 24, 5, 28, 0, green);
line(24, 5, 26, 26, 5, 26, 0, green);
set(24, 4, 26, "#d9a34e");
// Flat roof and raised parapet.
box(5, 10, 33, 42, 40, 33, "#d2c8ae");
box(7, 13, 34, 40, 37, 34, "#aaa99d");
box(5, 9, 33, 42, 10, 35, cream);
box(5, 11, 33, 6, 40, 35, cream);
box(41, 11, 33, 42, 40, 35, cream);
box(7, 39, 33, 40, 40, 35, cream);
box(18, 8, 33, 30, 12, 36, plaster);
box(17, 7, 36, 31, 12, 36, cream);
box(18, 7, 37, 30, 8, 37, "#d2a665");
// Argentine flag, high and unmistakable against the roof.
box(24, 25, 35, 26, 27, 36, plasterShade);
box(25, 26, 36, 25, 26, 46, "#818982");
set(25, 26, 47, "#e2b257");
for (let x = 26; x <= 38; x++) {
const wave = x >= 34 ? 1 : 0;
box(x, 26, 42 - wave, x, 26, 43 - wave, "#80cde3");
box(x, 26, 40 - wave, x, 26, 41 - wave, "#fff5df");
box(x, 26, 38 - wave, x, 26, 39 - wave, "#80cde3");
}
set(31, 25, 41, "#e9af37");
set(32, 25, 41, "#e9af37");
// Low dark-green iron fence, open at the central gate.
for (const [a, b] of [[4, 18], [30, 43]]) {
for (const z of [1, 3]) box(a, 4, z, b, 4, z, green);
for (let x = a; x <= b; x += 3) {
box(x, 4, 0, x, 4, 4, greenLight);
set(x, 4, 5, "#d5af62");
}
}
for (const x of [18, 30]) {
box(x, 3, 0, x + 1, 5, 5, green);
box(x, 3, 6, x + 1, 5, 6, "#dfbd76");
}import { draw } from "./assets/voxel";
import { escuela } from "./assets/escuela";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, escuela, 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 escuela
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["escuela"] })
# Queda en client/assets/escuela.ts
# https://fogon.page/object/escuela