From 69b0beba4444cd47f7a90af87415b518894da7ca Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 17:41:30 +0000 Subject: [PATCH 1/8] Pulsebox: neon disco restyle and rename of Beatvault, songs about 6% faster The player is a flat square of light, hazards are red-orange sparks, pickups are gold discs, and each of the six stages gets its own neon colours and motif. The name shown to players is Pulsebox; the folder, storage keys, stats id and level codes keep the beatvault name so saved data carries over. Every song's tempo is up about 6% with the level layouts unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DfCR7RPoK1UNAvb7iRuPWn --- README.md | 4 +- e63334287a3deaa3/beatvault/es.js | 40 +- e63334287a3deaa3/beatvault/index.html | 922 ++++++++++++++++---------- e63334287a3deaa3/es.js | 8 +- e63334287a3deaa3/index.html | 12 +- e63334287a3deaa3/leaderboard.js | 4 +- e63334287a3deaa3/m/index.html | 2 +- 7 files changed, 593 insertions(+), 399 deletions(-) diff --git a/README.md b/README.md index bd1ac441..e74483c5 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the - `e63334287a3deaa3/hush-pools/`: Hush Pools (Back Room), an original co-op horror obby for 1 to 4 players in flooded tiled pool halls (one file, three.js r128 with `../autores.js`, `../netsmooth.js` for teammates, Web Audio, Firebase Realtime Database rooms under `rooms/hp-`, same project and rules as Rumble Karts; invite links go through the home page as `#hp-`; Quick match uses `hp-pub-1` to `hp-pub-6`; rooms hold up to 4). The name, the monster, the rooms, the art and the sounds are all our own (everything is drawn and synthesised in code; no image or sound files). Players hop between floating tiles above water across nine rooms while a tall, blind monster wades the water and hunts **by sound only**. **Rules** are in the `// ==CORE==` … `// ==/CORE==` part of the script: plain data and pure functions with no DOM or three.js, the same in every browser and loaded as they are by the tests (below). `TUNING` holds every number worth tuning (gravity, jump, walk 4 / run 6.2 / creep 2 m/s, how loud each thing is in `TUNING.loud`, hearing radius 20 m × loudness × difficulty, memory 8 s, the monster's speeds and reach, grab 1.6 s, revive 2.6 s, shield 3 s, and so on); `DIFFS` is Easy (1 monster a room, bigger tiles, 50% coins), Normal (up to 3) and Hard (up to 5, smaller tiles, louder for the monster, 160% coins, opened by two Normal escapes). **Noise** is the core: every event is `{ x, y, z, l (loudness), src }` (`emit`), heard by a monster in the same room when it's within `hearRadius(l, df)`; falling in is loudest (1.0), clipping the water with your feet 0.7, a hard or edge landing 0.42, running on tiles 0.16, swimming 0.5, valves 1.05, a bottle 1.25 and its echo; walking and creeping are silent. Each noise shows as rings spreading on the water (the water shader's `uRings`, 14 at a time) and on the HUD's noise meter. **The monster** (`monStep`) drifts (0), goes to look at the loudest thing it remembers (1), lunges at a fresh noise close by (2), holds someone (3) or is stunned by a flare (4); memory fades over 8 s (`memWeight`), and it paths around tiles and pillars on a 0.5 m grid (`gridPath`). A lunge takes anyone in reach; otherwise it only takes someone who has just made a noise right next to it (walking into someone makes a bump that counts), so standing still and quiet beside a wandering monster is safe. Being grabbed shows a short face-to-face scare (a camera move, red edges, a screech; no blood), with a gentler version in Settings. **Rooms** (`ROOMS`, built from a seed by `buildWorld(df, seed)`): Pillar Hall, Broken Walkway (two routes), Sinking Tiles (light-edged tiles sink a moment after you land), Turning Bridge (planks that line up every 4 s), Moving Tiles, Currents (the water pushes you sideways), Memory Bridge (six rows of three tiles: the safe one in each row lights up in turn, the others sink under you), Crushing Walls (one lane in three is safe, shown by a green light) and the Maintenance Lock: two red valves (hold E, loud) raise the water and a stair, four number pillars give the keypad code, and the door out opens. Everything that moves is worked out from the run's clock and seed (`updateDyn`, `plankAngle`, `moverPos`, `crushOut`, `memLit`), so every browser agrees without sending it. **Items** (1–5): pebbles (6 to start, 3 more from each grey stone pile every 20 s; they skip on the water), bottles (loud, with an echo), wind-up toys (rattle for 8 s), flares (stun every monster within 6 m for 5 s and free anyone held) and rescue ropes (pull a downed teammate out from 8 m). A thrown item's flight is the same function in the thrower's browser (shown straight away) and on the host (which decides what it does: `stepProj`, `throwVel`). Under the water for 1.5 s, or held by the monster for its full grab, puts you **down**: a teammate holds E next to you (2.6 s) or throws a rope, and you come back with a 3 s shield; while down you watch a teammate. Everyone down sends the party back to the last checkpoint (the start of the furthest room reached). **Online:** each player writes only their own node `rooms/hp-/players/`: `n`, `c`, `x`, `z`, `h`, `ts` (the six the shared rules need), `y`, `j` (when they joined), `my`/`li`/`lv` (their lowest feet since the last update, their landing count and last landing speed: the host decides what those mean), `tp` (how many host moves they've applied), `hd` (what they're holding E on), `a` (pose flags), `up` (upgrade levels, 6 digits), `pk` (items packed for the run), `rd` (ready), `ac` (their last few actions as JSON, each with a rising `i` and the run number `g`), `ch` (proximity chat) and `pg` (a ping). The host is whoever has the highest `he` with a published state, else whoever joined first; it runs the run (`hostSense` turns each player's reported position into noises, falls, downs, checkpoints and coins, and checks speed and floating; `hostAct` checks every throw, pebble pickup, keypad try and rope; `hostStep` runs the monsters, items, valves, revives and the exit) and publishes it as JSON in its own node's `rs` about 10 times a second (`encodeRS`; clients check every value in `decodeRS`). Players move themselves (so jumps feel instant) and the host moves them only by teleport (`tp`), after a fall, a too-fast move, a revive or a checkpoint retry. If the host leaves, the next player rebuilds the run from the last snapshot (`stateFromRS`) and carries on. Someone who drops out keeps their place for 60 s (`TUNING.rejoin`) and the menu offers Rejoin (`hushpools:last`). `?dev=1` adds a fake-lag slider to Settings for testing. **Saved in this browser** (localStorage, all `hushpools:`): `name`, `set` (settings: sensitivity, field of view, volumes, gentler scare, invert, graphics, dev lag), `save` (coins, upgrade levels, items owned (at most 3 of each), Normal and Hard escapes, best time), `last` (the room of a run in progress, for Rejoin). Items you take into a run leave the shelf and whatever you didn't use comes back after it. **Coins** (no real money anywhere): 10 a room cleared and 50 for the escape, times the difficulty's factor; the lobby's Equipment stall sells bottles 15, toys 25, flares 30 and ropes 25, and the Upgrades stall has six upgrades at 40/90/160 coins a level (throw range, pebble skips and rescue speed from the start; toy battery, flare radius and rope reach once you've owned that item). **stats.js:** `add('escapes')`, `min('fastest', seconds)` (Normal or Hard only), `add('revives')`, `add('rooms')` and `add('hard')`; the Leaderboards show Elo, Fastest escape, Escapes and Rescues (see elo.js for how a co-op escape is rated). **Touch:** shown only on touch screens (`body.touch`): a stick on the left, drag anywhere else to look, and Jump, E, Throw (hold to aim), Run, Creep and Ping buttons; the HUD rearranges itself for an upright or sideways phone. **Tests** aren't in this repo (it has no build step or packages): the core is checked from outside with Node (`node:test`: noise and hearing, the monster's states and forgetting, item checks, seeds, the memory tiles and keypad, coins and upgrades, checkpoints, wipes, revives and valves), headless bots that play whole runs with the real physics (2 to 4 bots escape on Easy and Normal), and two headless browsers in one online room (joining, ready, falling in, going down, a rescue and the host leaving). Automated browsers get a test hook, `window.__hp`. - `e63334287a3deaa3/flipline/`: Flipline (Back Room), a one-button side-view stunt bike game in a cut-paper look (Canvas 2D and Web Audio, no Firebase except stats.js). Hold to ride; in the air the same hold tips the bike over backwards, so holding long enough is a flip; let go and the rider steadies the bike. Endless always opens with ~60 m of gentle ground. It is deliberately not like the neon line-art bike games: every layer is a filled paper shape with a soft drop shadow, the rider has a scarf on a little rope simulation, and hazards always look the same (berry red with cream stripes and teeth, outlined in ink) so they read by shape as well as colour in every place; coins are always gold rounds with a star. One self-contained `index.html` plus `es.js` (Spanish). Everything that decides what happens is the `FL` module between `// ==CORE==` and `// ==END CORE==`, with no DOM in it, so a Node script can run it on its own (the checks used for the first version did exactly that). **Physics** (`P`, every number with its unit): a chassis with two sprung wheel contacts and a belly skid, stepped 240 times a second whatever the screen does; held on the ground the back wheel pushes (10.5 m/s² from rest, fading to nothing at 17 m/s, never more than grip × load); released it coasts with a little rolling resistance; held in the air it spins backwards (up to 8 rad/s); released in the air the spin fades and, within 57° of level, the rider eases the bike level. A crash is the head or body touching the ground, a hazard, falling into a pit, landing more than 75° off the slope, or not moving forward for 5 s. Flips are counted from the rotation in the air against the change in ground slope (a flip from 308°), and only banked 0.22 s after a landing that didn't crash. Inputs carry their timestamps and take effect on the physics step they fall in, so the same timing gives the same run at 30, 60 or 144 Hz. **Scoring**: 1 point a metre, flips 100 / 300 / 600 / 1000…, a clean landing (within 15° of the slope after a real jump) +50 per flip and adds to the combo, which multiplies the next tricks (×1.5, ×2 … ×5) until a sloppy landing; near misses past a hazard +25, long air a bonus, coins +10. **Track** (`MOD`): 34 modules, each a function that writes ground from the current cursor and ends on level ground: flat, recover, roll, whoop, hill, valley, hump, kick, dkick, bigkick, tabletop, stepup, stepdown, stairsup, stairsdown, gap, gap2, gapup, gapdown, longjump, pillars, bridge, lpipe (a steep launch you have to flip off), dropin, seesaw, shuttle and lift (moving platforms), pend (swinging spiked ball), rotor, beams (low beams to ride under), crusher, saw, spikes and spikeroll. Ground is polygons for drawing and one-sided edges in 4 m buckets for collision. Moving hazards start their clock when the bike comes within 31 m and are timed so a bike at a good pace (`VD`, 14 m/s) meets them at their safest; keep the speed up and they swing out of the way. **Endless** (`endless(seed)`, `extend`) picks modules by weight with difficulty rising over 2600 m (`PICK`, `ENDLESS_RAMP`); every new module is checked by `vRun` (a point that always holds the button, at full and at 85% power, following the ground, flying off lips, landing, timing the moving hazards; it fails a module that hits a wall, falls in a pit, stalls or touches a hazard) and taken back out and replaced if it fails. The Daily run uses one seed per UTC day (`dailySeed`). **Levels** (`LEVELS`): 24 in four tiers of six, each `{id, n: name, th: place, f: flips target, t: time target in seconds, c: course}`, where the course is module tokens separated by spaces, numbers after colons, for example `flat:20 kick:1.1:26:16 pend:1:3.2:0 gap:6:0:0.7` (the arguments are each module's own, in metres, degrees and counts; see `MOD`). To add a level, add a line to `LEVELS` and check it with the bot (`botRun`), which plays from physics prediction by trying a few hold patterns ahead; all 24 were finished by the bot, which also set the time targets (its time + 12% + 1 s) and the flips targets (what a flip-seeking version of the bot managed). The track editor writes the same tokens, and its share code is `FL1.` + the text in base64; tracks stay on the device. **Saving**: localStorage `flipline:save` (versioned, `v: 1`): coins, owned and chosen vehicle, rider and place, Endless and Daily bests, per level medals (bits 1 finish, 2 flips, 4 time), best time and the ghost (the step numbers where the button changed, replayed through the same physics), challenge state (three active from 40 in `CH`, with progress), totals, secret-vehicle feats and settings (music, sound, mute, fewer effects, ghost). Vehicles (12 bought with coins, 3 secret: a quadruple flip, 1000 m without a flip, all 24 levels finished), riders (8) and places (6) are looks only: they all use the same physics. Coins only come from playing (score / 100 per run, coins picked up, medals and challenges). **Board**: `BackRoomStats.max('distance')`, `max('score')` and `add('runs')` after an Endless run, `max('medals')` after a level; Flipline's entry in leaderboard.js shows them. Controls through keybinds.js: Ride / flip (Space, up arrow, W; or the mouse, or touch anywhere), Restart (R), Pause (Esc, P). Restart is instant; after a crash any press goes again. A slow-motion replay of the last crash is on the results card (“Watch the crash”), never automatic. Test hooks (`window.__fl`, with manual stepping) exist only when `navigator.webdriver` is set. Nobody has played it by hand yet or listened to the sound; the feel numbers in `P` are the first thing to adjust. - `e63334287a3deaa3/tidewick/`: Tidewick (Back Room), a classic 8-bit style side-scrolling platformer for one player (Canvas 2D and Web Audio, no Firebase except stats.js). Pip, a child in a yellow raincoat, crosses a rainy harbour at dusk in two stages: **HARBOR 1** (the quay, about 210 tiles) and **HARBOR 2: THE BREAKWATER** (a short stone fortress over dark water, about 100 tiles) with a boss at the end. Unlike the other Back Room games it isn't one self-contained `index.html`: it's ES modules (the owner asked for them) in `js/`, loaded by ``, lists its actions in `Keybinds.create({game, actions: [{id, label, keys: ['KeyW', 'ArrowUp']}]})` (keys are `e.code` names, so they're physical keys on any layout; mouse buttons are `Mouse0`/`Mouse1`/`Mouse2` in games that pass `mouse: true`), checks input with `KB.is(action, e.code)` and `KB.held(action, keys)` instead of comparing key codes, and opens the panel from a Controls button with `KB.open()`. Changed keys are saved only in the player's browser, under localStorage `keybinds:` as `{v: 1, b: {action: [codes]}}` (only the actions that differ from the defaults; Reset to defaults removes the entry), and never go to Firebase. Esc is never rebindable. Elements with `data-kb="action"` show the current keys and update themselves. The panel takes each game's look from `--kb-*` CSS variables and the game's own button classes; the comment at the top of the file lists the options. To add it to a game, do the same, and keep text inputs (names, room codes, chat) returning before any key lookup. Touch controls don't go through key codes: each game's touch buttons feed its input directly (in Shell Crackers, Quarry and Backrooms they hold actions by id in `tAct`, which the game checks alongside `KB.held`), so they keep working whatever keys are bound, and the Change keys / Controls buttons are hidden in the touch layout (`body.touch`). **Spanish** (lang.js, when the page loads it): keybinds.js adds the panel's own words and common key and action names once (guarded by `if (window.BackRoomLang)`), and builds its messages and aria-labels with the action and key names in the page's language (a game's own dictionary supplies its action names); in English, or without lang.js, every string is as before. +- `e63334287a3deaa3/keybinds.js`: rebindable controls shared by the keyboard Back Room games (2048, Backrooms 1v1–4v4, Boostball, Coil, Escapade, Gridpop, Hail Mary, Kartwheel, Melon Merge, Odd One Out, Quarry, Rumble Karts, Shell Crackers, Slipstream, Spire, Stackfall, Starhop, Tumble Trials, Turbo Trail, Updraft, Driftfall, Asteroid Run, Rampline, Tidewick, Flickerwood, Pulsebox). Plain JavaScript, no dependencies. Each game loads it with ``, lists its actions in `Keybinds.create({game, actions: [{id, label, keys: ['KeyW', 'ArrowUp']}]})` (keys are `e.code` names, so they're physical keys on any layout; mouse buttons are `Mouse0`/`Mouse1`/`Mouse2` in games that pass `mouse: true`), checks input with `KB.is(action, e.code)` and `KB.held(action, keys)` instead of comparing key codes, and opens the panel from a Controls button with `KB.open()`. Changed keys are saved only in the player's browser, under localStorage `keybinds:` as `{v: 1, b: {action: [codes]}}` (only the actions that differ from the defaults; Reset to defaults removes the entry), and never go to Firebase. Esc is never rebindable. Elements with `data-kb="action"` show the current keys and update themselves. The panel takes each game's look from `--kb-*` CSS variables and the game's own button classes; the comment at the top of the file lists the options. To add it to a game, do the same, and keep text inputs (names, room codes, chat) returning before any key lookup. Touch controls don't go through key codes: each game's touch buttons feed its input directly (in Shell Crackers, Quarry and Backrooms they hold actions by id in `tAct`, which the game checks alongside `KB.held`), so they keep working whatever keys are bound, and the Change keys / Controls buttons are hidden in the touch layout (`body.touch`). **Spanish** (lang.js, when the page loads it): keybinds.js adds the panel's own words and common key and action names once (guarded by `if (window.BackRoomLang)`), and builds its messages and aria-labels with the action and key names in the page's language (a game's own dictionary supplies its action names); in English, or without lang.js, every string is as before. - `e63334287a3deaa3/school.js`: Your school (Back Room page, the home page's copy of it and the phone page). A small box at the end of the page header where each player picks the school they go to: one button per school plus Not listed, as a radio group (click, or the arrow keys). The schools are Avenues (New York) and St. Andrew’s Scots School (`standrews`, Olivos, Buenos Aires, Argentina; a bilingual English–Spanish school, so lang.js's Spanish matters there); to add one, add a row to `SCHOOLS` (`id`, a short lowercase id that never changes, `name`, `place`). The script fills in every empty `[data-school]` element: the Back Room page has one at the end of its `
` (so the home page's `reveal()`, which copies the header, gets it too, and loads the script after `events.js`), and the phone page has one at the end of its header. Being in the header, layout.js never moves it. **Storage:** localStorage `school:v1`, the school's id (`avenues`) or `other` for Not listed; no key means nothing picked yet. It is in account-nudge.js's `KEYS`, so a Google account's save carries it to the player's other devices (visible to other signed-in browsers, like everything in that save). Nothing else is stored online. **Search and Add my school:** only schools marked `suggest: true` in `SCHOOLS` (Avenues) are shown before a search, plus the one the player picked; every other school is found by typing in the search box above the choices, which filters them as you type (name and place, accents ignored; Enter picks the first match). With no match, or from the dashed "Add my school" button, a small form asks for the school's name, its city or town and its country (only the general area; it says not to put a name or address) and sends one note through the suggestion box (`BackRoomFeedback.send` in feedback.js, the same sealed `feedback` documents, limits and admin Feedback tab, so no new storage or rules): "School request: (, ). Sent from Your school." The player's choice becomes Not listed, and localStorage `school:req` ({n, p, t}, also in account-nudge.js's KEYS) remembers what they asked for, so the box says "You asked us to add … We'll add it soon." To add a requested school, read it on the admin page's Feedback tab and add its row to `SCHOOLS`. Nothing uses the choice yet: other scripts can read it with `BackRoomSchool.get()` (the row, or null) and hear changes through the `backroom:school` event on `document` (`{id}`). - `e63334287a3deaa3/news.js`: What's new (Back Room). A slim strip under the page header, above the Party panel, on the Back Room page and the phone page (one ` - + -Beatvault +Pulsebox - +