← Piezas de nivel 2Objeto 3Dfogon/nivel-cartel-de-flecha
Cartel de flecha
Arrastrá para girarlo// «Cartel de flecha» · gpt-6-sol (medium)
// A wooden arrow sign: a thick wooden post 4x4, 30 tall, and on top a wooden board shaped like an arrow pointing right (+x), 30 long, 12 tall, 3 thick, warm brown with a darker border and a big white painted arrow on its front (-y); two dark nails.
const dark = "#75401f";
const brown = "#b96d30";
const light = "#d88a40";
const white = "#fff8e8";
// Solid 4×4 post, 30 blocks tall.
box(22, 23, 0, 25, 26, 29, brown);
box(22, 23, 0, 22, 26, 29, light);
box(25, 23, 0, 25, 26, 29, dark);
box(22, 23, 0, 25, 23, 29, "#c67a35");
box(22, 23, 0, 25, 26, 1, dark);
box(22, 23, 27, 25, 26, 27, "#9c5428");
// The 30×12 arrow board, three blocks thick.
function onBoard(x, z) {
if (z < 29 || z > 40) return false;
if (x >= 9 && x <= 31) return true;
if (x > 38) return false;
const inset = Math.ceil((x - 31) * 0.8);
return z >= 29 + inset && z <= 40 - inset;
}
for (let x = 9; x <= 38; x++) {
for (let z = 29; z <= 40; z++) {
if (!onBoard(x, z)) continue;
const edge =
!onBoard(x - 1, z) || !onBoard(x + 1, z) ||
!onBoard(x, z - 1) || !onBoard(x, z + 1);
for (let y = 20; y <= 22; y++) {
let color = edge ? dark : brown;
if (y === 22 && !edge) color = "#a65d2b";
if (z === 40) color = light;
set(x, y, z, color);
}
}
}
// Subtle wood grain on the front.
for (let x = 13; x <= 23; x++) set(x, 20, 31, "#c77a36");
for (let x = 16; x <= 24; x++) set(x, 20, 38, "#a95e2b");
// Large, crisp white painted arrow.
box(15, 20, 33, 28, 20, 36, white);
for (let x = 27; x <= 35; x++) {
const inset = Math.floor((x - 27) / 2);
for (let z = 30 + inset; z <= 39 - inset; z++) {
if (onBoard(x, z)) set(x, 20, z, white);
}
}
// Two dark nail heads, with tiny highlights.
set(12, 20, 38, "#44352b");
set(29, 20, 39, "#44352b");
set(12, 20, 39, "#9d8971");
set(29, 20, 40, "#9d8971");import { draw } from "./assets/voxel";
import { nivelCartelDeFlecha } from "./assets/nivel-cartel-de-flecha";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, nivelCartelDeFlecha, 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-cartel-de-flecha
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["nivel-cartel-de-flecha"] })
# Queda en client/assets/nivel-cartel-de-flecha.ts
# https://fogon.page/object/nivel-cartel-de-flecha