diff --git a/src/features/neon.js b/src/features/neon.js new file mode 100644 index 0000000..b119d4c --- /dev/null +++ b/src/features/neon.js @@ -0,0 +1,19 @@ +// Seed #5: the neon sign over the lobby cabinets. It buzzes off for a beat now and then. +import { PAL } from "../palette.js"; +const GLYPH = { A: ["010", "101", "111", "101", "101"], R: ["110", "101", "110", "101", "101"], C: ["011", "100", "100", "100", "011"], D: ["110", "101", "101", "101", "110"], E: ["111", "100", "110", "100", "111"] }; +export default { + id: "neon", + order: 5, + layer: "mid", + rooms: ["lobby"], + draw(g, w) { + const on = w.reduced || Math.sin(w.t * 0.9) > -0.92; + const word = "ARCADE"; let x = 112; + g.fillStyle = PAL.ink; g.fillRect(104, 42, 112, 30); + for (const ch of word) { + const rows = GLYPH[ch]; + for (let y = 0; y < 5; y++) for (let i = 0; i < 3; i++) if (rows[y][i] === "1") { g.fillStyle = on ? PAL.pizza : PAL.winOff; g.fillRect(x + i * 4, 48 + y * 4, 3, 3); } + x += 16; + } + }, +};