From ebeea1cd095801e87010b42724be1153525aec60 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 18:48:50 -0500 Subject: [PATCH] Flipline: flip with the arrow keys, and gravity in the air MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Space / up arrow / W / mouse is now just the gas; ← (A) spins the bike backwards and → (D) forwards in the air, and leans the rider on the ground. - No more automatic levelling in the air: spin keeps going until you stop it, and gravity drops the nose (GRAV_PITCH), so landings need steering. - Touch screens get two round lean buttons bottom-left; touch elsewhere is gas. - Ghosts store gas + lean (gv: 2); old one-button ghosts are ignored. - Bot and menu demo steer with the arrows; all 24 levels re-checked: every finish, flips and time medal is still reachable. - README, What's new (1.38) and Spanish updated. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016ZY4GZJefED59cg4CZ2aEJ --- README.md | 2 +- e63334287a3deaa3/flipline/es.js | 12 ++ e63334287a3deaa3/flipline/index.html | 169 +++++++++++++++++---------- e63334287a3deaa3/index.html | 2 +- e63334287a3deaa3/news-es.js | 6 + e63334287a3deaa3/news.js | 8 ++ 6 files changed, 135 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 03aa7b9d..3a26eeb9 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the - `e63334287a3deaa3/rollaway/`: Rollaway (Back Room), an endless single-player marble runner (Three.js r128, no Firebase except stats.js). A heavy marble rolls on its own down a sun-bleached sandstone aqueduct high above a sea of cloud at sunset; the player only steers, it speeds up from 13 m/s to 40 m/s over about two and a half minutes (`vAt`, 3,600 m, then slowly to 46), and rolling off an edge or touching a hazard ends the run. **Look:** warm sandstone decks with terracotta edge bands (drop edges always have the band; walls that are safe end in a raised rail), stone piers and arches under the deck, broken-off ends at every gap, a painted sky dome whose panorama also lights everything (`scene.environment`, made once from a canvas), a scrolling cloud sea and far rock towers; hazards are all dark iron with cream and rust bands and pointed shapes (posts, rolling drums, pendulums under stone gantries, stampers), so they read by shape and value, not only colour; gems are rounded cyan crystals. No outside images: every texture is drawn on a canvas at load. Everything that isn't drawing is the `RA` module between `// ==CORE==` and `// ==/CORE==`, with no DOM or Three.js in it, so a test can run it in Node: tuning (`P`), speed and difficulty by distance, the track generator (`Track`, `MODS`), the fixed 1/120 s physics (`step`), the bot (`Bot`, `botPlan`) and the passability check (`validate`). **Physics:** the track is a centre line (one sample per metre: position, heading, curvature, bank) with deck pieces that each cover a stretch of it and a sideways range that can narrow, widen or shift; the marble lives in track space (distance `s`, sideways `u`, height `y`). Forward speed depends only on distance, so the time the marble reaches any point is known in advance (`tAt`) and every moving hazard is phased to leave a way through when it arrives. Steering is a sideways force (`A_STEER` 28 m/s², 1.5× when steering against the drift), damped by `GRIP` (4.2/s, 6.5 with no input) so it drifts a little and never slides on ice; a curve pulls outward by v²κ unless the deck is banked; walls and banks push back by gravity along the slope (`G` 22 m/s²); in the air steering is 35 %. Landings faster than 3.2 m/s bounce at 28 %; ramps launch, gaps are cleared by flight, and a marble below any deck that could catch it is out. **Track:** a new seed every run (the Daily run uses one from the date, so everyone gets the same course all day), assembled module by module from 28 modules in four groups (rests: straight, banked turn, flat curve, S-bend, rollers, plaza; layout: narrow beam, half-pipe, curving half-pipe, fork with a narrow risky branch full of gems, zigzag, eye, crossing beams, holes, stepping stones, tilting slabs, wall ride; air: ramp over a gap, double gap, terrace drop, ramp onto islands; hazards: post slalom, post gates, rolling drums, pendulums, pendulums over a beam, stampers, a mixed gauntlet). Every run opens the same way before the seeded modules begin: the start plaza, a wide straight, then one post in the middle of a wide deck about 140 m in, so the first steering choice always comes early and is always easy. Difficulty (`diffAt`, 0 to 1 over 3,800 m) sets deck width (6 m down to 3.6 m), beam width, seconds between hazard rows, gap length as a share of the flight, curve tightness and how many rows a module has; `_pick` adds the connection rules (never the same module twice, a rest after one to three hard modules, never two launches in a row, a plaza and a 13 % speed breather every 800 m). **Checking it:** `RA.validate(track, metres)` follows every reachable state (all states share distance and time, so it is exact) with only 80 % steering, hazards 12 cm bigger and decks 6 cm narrower, and reports any module nothing gets through; `new RA.Bot(track)` looks 1.5 s ahead by simulating its choices on the real track. After changing a module or a physics number, run both in Node on a few hundred kilometres of seeds. **Score:** distance times a multiplier that rises 0.1 per gem and 0.25 per close call (passing a hazard within 0.6 m) and settles back after 4 s; gem chimes climb a scale while you keep collecting. A milestone banner and stone gate every 500 m; a gold strip with two BEST flags across the deck where your best run ended (the Daily run's own best on a Daily run). **Marbles** (cosmetic, by best distance): Lapis, Sunstone 500 m, Glacier 1,000 m, Jade 1,500 m, Ember 2,000 m, Tiger Eye 3,000 m, Nightfall 4,000 m, Pearl 5,000 m; each texture has a light seam so the roll always shows. **Audio** is all Web Audio: rolling rumble and hum by speed and surface, wind rising with speed, landing thumps, a close-call whoosh panned to the side, gem chimes, and a 112 BPM loop in four layers (pad, bass, hats, kick, arpeggio) that come in as the speed rises; Volume, Music, Effects and Mute (M) in Settings. **Controls:** A/D or the arrow keys (rebindable, `keybinds:rollaway`), optional mouse steering; touch: drag left and right anywhere (a floating stick, the default), or hold either side of the screen, and optional tilt; a steering sensitivity slider; R or Space restarts at once (under a tenth of a second). **Drawing:** the deck is built in 16 m chunks from a pool of meshes rewritten in place (one draw call each), piers and arches are two instanced meshes, each hazard kind one instanced mesh, gems one plus one for their halos; world positions are kept near zero by a floating origin. Graphics Auto / Low / Medium / High (`QP`: resolution, view distance, shadow map on High only, normal map, second cloud layer), plus `../autores.js`. Saved in the browser only: `rollaway:save` (`{v: 1, best: score, bestD: metres, runs, gems, ball, daily: {day, best, bestD}, how}`) and `rollaway:set` (quality, sensitivity, reduce effects, volumes, mute, touch mode, tilt, mouse). Stats hooks at the end of every run: `max('distance', metres)`, `max('score', score)`, `add('runs', 1)` (the Rollaway row in `../leaderboard.js`). **Spanish:** `rollaway/es.js` (marble names stay English); text built in code goes through `TX()`. In an automated browser `window.__ra` drives it (`startRun(daily, seed)`, `bot(true)`, `run(seconds, hz, draw)`, `state()`, `info()` for draw calls and triangles). - `e63334287a3deaa3/rampline/`: Rampline (Back Room), a low-poly stunt time-trial racer with a track builder, online boards and community tracks (Three.js; Firebase Realtime Database only for the boards and community tracks, under the prefix `rl`, plus stats.js). One small car, one track, the clock: 30 built-in tracks in four tiers (`TIERS`: Green, Blue, Red, Black), your own tracks from the builder, and tracks other players publish. Everything that isn't drawing is the `RL` module between `// ==CORE==` and `// ==/CORE==`, with no DOM or Three.js in it, so a Node script can run it on its own: the pieces (`PIECES`), building a track (`buildTrack`), the car physics (`newCar`, `step`), share codes, ghost recordings, the checks (`validate`), the track-writing cursor (`Course`), the tracks (`TRACKS`, `trackOf`) and the checking bot (`runBot`). **Pieces** sit on a grid of 10 m tiles and 2 m height steps with a quarter-turn (`{t, x, y, z, r, w}`: type, tile, height, turn, side walls); each has the tiles it covers (`fp`), how many height steps above it it keeps clear (`hh`) and its ports (where road leaves it). Pieces: straight, curves (tight, normal, wide, huge), S-bends left and right, slope, steep slope and long climb (+1, +2, +3 steps), climbing curves left and right (+1 step while turning), bump, two banked curves, boost pad, kicker and big ramp (no exit port: they launch you), loops leaning left and right, wall ride, narrow road, gap, platform, start, checkpoint, checkpoint ring (an arch instead of posts), finish, and scenery (tree, rock, arrow sign). The order of `PIECES` is part of the share-code format: only ever add to the end (the pieces from curveXL on were added with the handling pass). Raised road gets **pillars** down to the ground automatically (`pillars` in `buildTrack`), every 10 m or so, only where no other piece is below that tile and always below the road surface. **One set of triangles:** `buildTrack` turns every piece into triangles that are both the collision geometry (type 0 road, 1 solid; `FX` 1 marks a boost pad, 2 a slab end that meets another piece's (inside the road), 3 the side of a piece that twists) and, merged with one colour each, the single drawn mesh; positions are rounded to 1/1024 m. Pieces that twist (`tw`: the two banked curves and the wall ride) also keep, per road triangle, the surface's real normals, the twist of its quad, how far across the road each corner is and the way across (`X3`, `XD`), used only by the newer contact rules below. **Physics** (`PH`, `PHYS_V` 2, fixed 1/120 s step, only + − × ÷ and √ while stepping, so a recording of inputs replays to exactly the same run on any device): the car is a point riding 0.55 m above the road with two 0.75 m spheres for hitting things. **Contact rules** (`car.pv`; `PHYS_NOW` 3 for every new run, 2 for recordings from before the side-ramp fix, which replay with the old rules bit for bit; same car, same boards): on flat road, curves, slopes and loops the two are the same run for the same inputs, except where rules 2 hit a slab end. Rules 3 differ in four ways. (1) A road that twists climbs or drops along the way you drive anywhere off the line it twists round, by up to 40°, which the frame's up (`n`, what the driving uses, so banks and wall rides handle as before) doesn't know: the body now leans with the real surface (`car.bd`, `bodyPose`: where the car is drawn and where its spheres sit), so the nose no longer digs through the road into the slab's underside (a dead stop anywhere off the middle of a wall ride, and on the outside of a bank above about 200 km/h) and the car no longer sinks into or floats over the road by up to 0.8 m. (2) The ride height there follows the smooth surface through each quad's four corners instead of the ridge or dip its two triangles make (up to 13 cm, at every quad). (3) A car on the road never hits a slab end where two pieces join (it used to when its nose dipped below road level: landing nose-down near a join, or at the bottom of a slope above about 290 km/h: a dead stop, a shove or a bounce), nor the side of the twisting piece it is riding (the wall ride's low edge used to bounce cars back up the wall; now they drop off it). Open ends (a ramp's lip, the two sides of a gap) are as solid as ever, so jumps are unchanged. (4) The wall ride lifts its middle as it rolls up, which slid the road about 2 m sideways under a car that wasn't steering, towards the low edge; now a car on it keeps its place across the road (`laneKeep`). Not changed: too fast into a bank still throws you off at its exit, and the blunt start of a barrier after a piece with none (wall ride, loop, gap) still stops a car that hits it head-on. Acceleration 20 m/s² tapering to nothing at 82 m/s with drag: 0–100 km/h in 1.5 s, 0–200 in 3.8 s, top speed about 252 km/h. Steering lock and rate fall off with speed (full lock turns in 6 m at 30 km/h and about 55 m at 150 km/h), and the turn rate is capped a little above what the tyres hold, so holding full lock at speed slides a little. **Drifting:** let go of go and tap brake while steering at more than 50 km/h: the nose holds an angle set by the steering (`driftAng`), grip is a little higher than normal (`driftK`), so you get round a tight corner at speed (about 75 % of the grip turn's radius, for 3–8 % of your speed); it lasts while you keep steering and the car is sideways. Downforce grows with speed (`stick` plus `stickHi` above 30 m/s), which keeps you on loops, wall rides and most crests; the fastest cars still fly over sharp crests. A share of the road's turn at take-off carries into the air as spin (`carryW`); in the air the **air brake** (input 32, Space or Left Shift, or the brake) damps the spin and levels the car for the landing; landing square keeps your speed, crooked costs up to 70 % (with the air brake the bot's landings cost 2–5 %, without it up to 70 % and falls). Boost pads give 1.4 s of extra push up to 1.3 × the top speed. Walls take the speed into them, turn the nose along them and never push a car on the road upwards (barriers on banks and loops lean); of the speed along the wall a light brush keeps 96% and a square hit 40% (`walls()`; 92% and 35% until November 2026, eased a little because every touch felt costly once tight corners had real inside barriers). Falling off (or 6 s in the air) puts you back at the last checkpoint 0.25 s later with the speed you had there; Backspace does it at once. **A run that went back to a checkpoint doesn't count** (no best, ghost, medal, stats or board), and the HUD shows "Practice". Starting a track and R are both instant and plain (restart under a millisecond): no countdown, no camera move and no fade; the car waits on the line with the camera already in place, and the clock starts with your first drive key. The menu sits over a still view of a track. Splits against your best show at every checkpoint and at the finish. **Gates:** a checkpoint counts when you cross it either way; the finish only counts going forwards, once every checkpoint has been passed. **Tracks** are written with the `Course` cursor (`s`, `L`/`R` curves with `S`, `M`, `L`, `X` sizes, `sL`/`sR`, `bL`/`bR`, `up`/`down`, `climb`/`drop`, `cuL`/`cuR`/`cdL`/`cdR`, `bump`, `boost`, `ring`, `loop`, `wall`, `narrow`, `gap`, `ramp` + `jump(n, dy, speed cap)`, `plat`, `cp`, `fin`), each with its look (`th`). After changing a track or the physics, run the bot: it drives with the real `step` and only a player's keys (it slows for crests that lead into corners and for jumps' speed caps, uses the air brake, and never starts a drift by accident; `pv` picks the contact rules, and with rules 3 it doesn't steer against the wall ride's old sideways slide), in 13 styles; every track must be finished cleanly by at least one, and the same inputs must replay to the same time. `MED` ([builder, gold, silver, bronze] in ms) comes from it: builder is the bot's best clean time rounded up to 10 ms, gold 1.05 ×, silver 1.2 ×, bronze 1.45 ×, rounded up to 0.1 s. Built-in tracks run 24–49 s for the builder time. The 20 tracks from the first version got longer layouts (layout 2) with the handling pass: a best from the first layout is kept in the save as `pb[id].old = {t, m}` (shown on the track card as "Old layout", and its medal `m`, worked out with `OLD_MED`, still counts). **Looks:** three environments of our own, chosen per track (`th`, or Look in the builder): Summer valley, Snowy pass, Desert canyon (`THEME`: sky, fog, ground, hills, the colours of its light (`hs`, `hg`, `sun`, `em`, so hills and trees take the look's colours), its dust colour, and recolouring of trees, rocks and road sides). **Ghosts:** a ghost is a recording of inputs driven through the same physics once (`GTrack`, every step's pose kept, built a little ahead of where it's needed), so up to 10 race at once with almost no cost and never collide: your best (the Ghost setting) plus any you tick on a board. **Online** (signed in anonymously only when first used; the shared rules only let a player write their own node, which needs n, c, x, z, h, ts): `rooms/rl-b2-/players/` is a player's board entry for a track (`t` best ms, `k` car, `p` paint, `pa`, `a`, and `lk` only when a Captain's garage look is worn, see below), `rooms/rl-g2-/players/` the ghost behind it (`t`, `g` the inputs, `f` 2, `v` the contact rules it was driven with: 2 or 3), where `` is a built-in track's id or a custom track's `trackKey` and "2" is PHYS_V (new physics, new boards; the contact rules share one board). A clean new best is uploaded if it beats the account's entry. The top 10 shows only entries whose ghost, fetched and driven again on this device, finishes cleanly in exactly the claimed time with the contact rules it names (`Online.verify`; results cached in `rampline:vc`), so a made-up time or an edited recording never shows. A page from before rules 3 checks every run with rules 2, so until it is reloaded it doesn't list runs driven with rules 3. `rooms/rl-tracks/players/` holds a player's published tracks (`tr: {: {nm, code, at}}`, at most 5, at most 800 pieces each, and only after a clean finish of it), `rooms/rl-plays/players/` who raced which published track (`p: {: [best ms, last played]}`, 150 at most). **Community** lists published tracks (newest, most raced, raced this week), with the featured track of the week on top (the most raced in the last 7 days, else one picked by the week number), each with its own top 10; names and track names go through `/namefilter.js`. Hide and Report hide a track in this browser only (`rampline:hidden`); there is no shared report list, so Report tells the player to use Tell us. **Replay viewer:** watch any of your last 12 runs (`rampline:runs`) or a board run, with play/pause, frame steps, ¼× to 2×, a timeline, and a graph of speed over distance that can lay a second run (your best or a board run) over the first. **Builder:** a free camera (middle-drag to look round, right-drag, Shift-drag or WASD to pan, wheel to zoom, Shift + wheel or Q/E for the build height), a palette (keys 1–0 for the first ten), click or tap to place (R turns it; the preview shows arrows where the road leaves), right-click, X then click, or the bin to delete, the select tool (V: click, Shift-click or drag a box) to move (M, or M over a piece to pick it up), copy (Ctrl+C), cut (Ctrl+X), paste (Ctrl+V, R turns the group, Esc cancels and puts a moved group back) or delete pieces, Ctrl+Z / Ctrl+Y undo and redo (200 steps), Look (theme), a check, Test drive (T), Share, and Publish (in Track builder's list). **Share codes:** `RL1.` + base64url of: version 1, name length + UTF-8 name (≤ 40 bytes), piece count (2 bytes), 5 bytes a piece (type, x + 128, z + 128, y, turn + 4 × walls), then an FNV-1a checksum (4 bytes); version 2 is the same with a theme byte after the version (theme 0 is still written as version 1, so older copies read it). `decodeTrack` checks everything and returns a plain message for anything wrong. **Saved in the browser:** `rampline:save` (`{v: 1, pb: {: {t, sp, n, name, lv, old}}, runs}`), `rampline:ghost:` (`{v: 2 or 3 (the contact rules), f: 2, t, g}`: your best run as inputs, one byte per step (1 go, 2 brake, 4 left, 8 right, 16 back to checkpoint, 32 air brake) in runs of varint(count × 64 + input), base64url; version 1 ghosts used count × 32 and the old physics, and are left alone), `rampline:runs` (each with `v`, the contact rules; none means 2), `rampline:tracks`, `rampline:hidden`, `rampline:vc`, `rampline:set` (`vol, mute, cam, gfx, car, col, ghost`), `rampline:garage` (`{v: 1, car, col, pat, acc, rim, trail, name}`: car, paint, pattern (plain, stripe, twin stripes, two-tone) and its colour, rims, exhaust trail (off, smoke, flame, rainbow) and the name on the boards; account-nudge.js syncs it) and keys under `keybinds:rampline`. Stats hooks: `min('r2-', seconds)` for every clean built-in finish (stats.js's `LOWER`; the old `t-` names stay there for first-layout times), `max('medals', n)` (1 to 4 a track, old-layout medals included) and `max('golds', n)`. Drawing: the track is one merged mesh, each gate banner its own mesh, the car one mesh plus its wheels as one `InstancedMesh`, each ghost the same plus a name tag, dust and the exhaust trail a point cloud each, speed lines one line set; with no ghosts racing is about 17 draw calls, with 10 ghosts about 43 (logic under 1 ms a frame). **Drawn-only extras** (none of them is in the `RL` module, the physics or the track format, so times and share codes don't change): the **ground** is one mesh made in `buildScenery`, a patchwork of flat triangles in slightly different tones round the track (at most 32 × 32 cells, tones fading out at its edge) plus four plain sheets out to the horizon, so every bit of ground is drawn once (drawing a second ground under it cost about a fifth of the frame on slow graphics); the **centre dashes** on the road are their own mesh (`makeRoadLines`), swept from the same frames as the road (`RL.framesWorld`), on every other segment so they line up with the kerb stripes, a hair above the surface, skipped where the road twists (bank and wall-ride entries), on boost pads and at gates; dust and exhaust use one small shader (`fxPointsMat`) that gives each point its own colour, fade and size, so puffs grow and fade instead of popping: landings throw a ring in the look's dust colour, sliding leaves pale tyre smoke from the back wheels, and a boost pad's push shows as a flame from the exhaust when no garage trail is chosen; on the Fast graphics setting (`gfx: 'low'`, where nothing casts shadows) the car gets one soft dark patch under it (`blobStep`: on the road while driving, on whatever is below while flying, one ray a frame only in the air). The camera widens its view and pulls back with speed, and speed lines (short streaks kept to the edges of the view, never across the car) fade in above about 90 km/h; the Speed effects setting (menu and pause, `set.fx` in `rampline:set`, on by default) turns both the widening and the lines off. On touch screens the page adds `touch` to `body` (steer bottom left, GO and BRAKE bottom right, BRAKE in the air is the air brake, checkpoint/restart/camera/sound/pause top right); the builder works by tapping, with one finger to look round, two to pan and pinch, and the select tool's bar (Move, Copy, Delete, Done) above the palette. **Captain's garage (hidden, not public yet):** 42 more cars (normal cars, work vehicles, toy cars and silly cars, from a muscle car to a rubber duck, and from the second wave in November 2026 sports cars, a team bus, ice resurfacer, golf cart racer, football helmet and soccer ball, and pirates, suits and robots, a pirate ship, black sedan, VIP limo, armoured van, robo walker and lowrider: car numbers 32 to 42), 25 paints, 12 wheel designs, 10 tyre smokes and 13 horns, all drawn in code in `garage.js` beside the page and numbered as in `cosmetics.js` (game `rampline`). `RAMPLINE_PUBLIC = false` in `index.html` is the one switch; until it is flipped, `garageOn()` asks `captains.js` (`may(false, 'garage', 'rampline-garage')`), so only the site's captains, or `?garage=1` on localhost or in an automated browser, see the "Captain's garage" button at the end of the Garage card and its screen (front and back pictures rendered from the real models, tabs for cars, paint, wheels, tyre smoke and horn). Everything is free to wear; nothing is bought and the shop stays shut. What a captain wears is saved as `rampline:cos` (`{v: 1, car, paint, wheels, smoke, horn}`, item numbers, 0 for none; not synced to the account) and, for what shows on a ghost, goes on their board entries as `lk` = `"1..."` beside the old `k` and `p` (which stay the garage car and colour, so pages from before it draw the garage car as before). Reading a board, `lkOf` checks the string's shape and `garage.js`'s `parse` every number; unknown numbers are drawn plain. `garage.js` is fetched only for a captain or when a board row has an `lk`; for everyone else nothing changes. A paint repaints the car's own paintwork (with none, a car with a colour of its own, such as the school bus or the taxi, keeps it; the rest take the garage swatch); wheels replace the car's own wheels or the garage rims. Tyre smoke recolours the slide smoke and the horn plays on H (only if no control is bound to H) or a horn button above the steering on touch screens; both are yours only. Looks only: every car is still one mesh plus one `InstancedMesh` of wheels (up to six, each its own size), 120 to 650 triangles, so the draw calls are unchanged; all fit about the same box as the garage cars; a car that would sit in front of the Hood camera hides its body in that camera only. A test hook (`window.__rl`) exists only when `navigator.webdriver` is set; with `GX` it has `sheet()` and `wheelSheet()` (contact sheets of every car and wheel). It has Spanish (`rampline/es.js`, through `../lang.js`; EN | ES switch next to Speed effects in both settings panels): menus, how-to-play, results, boards, community, the track builder and its checks, and the captains' garage; the builder's checks stay English inside the code (the page translates them with `_t()` when it shows them, because `T` is the tile size there), and track names and players' track names are never translated. - `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 across nine big, misty halls of knee-deep water while one tall, blind, very fast monster hunts them **by sound only**. The water is shallow (you wade, slowly and noisily, and can always jump back out; nobody drowns), and the mist (`FOG_NEAR`/`FOG_FAR` in the renderer, about 15 m in the halls, clear in the lobby) hides the far wall and the monster until they're close. **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 (bigger tiles; the monster is 0.8× as fast, hears less and waits longer before it rushes; 50% coins), Normal and Hard (smaller tiles; 1.2× as fast, hears more, rushes sooner; 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, wading 0.45 a step (0.62 running, 0.24 creeping), climbing out 0.3, 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`): there is one, and it follows the party from hall to hall. It drifts (0), goes to look at the loudest thing it remembers (1), freezes and turns towards a fresh noise close by (7, for `TUNING.react` s), then rushes at it at about 14 m/s (2), holds someone (3) or is stunned by a flare (4). When most of the party is in another hall it sinks under the drains (5, `partyRoom`) and rises somewhere in that hall far from everyone (6, `riseSpot`); it hears nothing while it's under. Memory fades over 8 s (`memWeight`), and it paths around tiles and pillars on a 0.5 m grid (`gridPath`). A rush takes anyone within 2 m at the end of it, so the way to survive one is to be far away or to get moving the moment you hear its shriek; 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 hard cut to its face lunging at you, a red strobe and a distorted screech, then black with TAKEN; no blood), with a gentler version in Settings. **Halls** (`ROOMS`, built from a seed by `buildWorld(df, seed)`): each is 56 m wide (`RHW`) and 56 to 70 m long. Its obstacle course is placed somewhere across the hall (`newRoom`), and `furnish` adds stepping-stone trails from the door you came in by to the course and from the course to three doors in the far wall, only one of them open (`W.doors`, `real`; the open one leads into the next hall), plus dead-end trails, lone stones and pillars, all from the seed. The courses: 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 the monster for 5 s if it's within 6 m, and free anyone it's holding) 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`). Being 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, wading and climbing out, the monster's states, rush, forgetting and following the party, item checks, seeds, the halls' doors and stepping stones, the memory tiles and keypad, coins and upgrades, checkpoints, wipes, revives and valves), headless bots that play whole runs with the real physics (1 to 4 bots escape on Easy, Normal and Hard), and two headless browsers in one online room (joining, ready, falling in and wading, being grabbed and 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/flipline/`: Flipline (Back Room), a side-view stunt bike game in a cut-paper look (Canvas 2D and Web Audio, no Firebase except stats.js). Hold the gas to ride; flips are on the arrows (← spins backwards, → forwards; on the ground they lean the rider back into a wheelie or over the bars). Gravity is on: nothing levels the bike in the air, a spin carries on until the player stops it, and the heavy front end drops the nose. (Until 20 Nov 2026 it was one button: holding in the air tipped the bike backwards and letting go levelled it.) 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; `step(tr, s, hold, lean)` takes the gas (true/false) and the lean (-1 ←, 0, 1 →). Gas 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); off, it coasts with a little rolling resistance. In the air an arrow spins the bike that way (18 rad/s², up to 8 rad/s, `AIR_ACC`, `AIR_WMAX`); with no arrow the spin only fades slowly (`AIR_DAMP`); and gravity drops the nose all the time (`GRAV_PITCH` × cos(angle), so an untouched bike noses over on long jumps but small hops still land). On the ground an arrow adds a lean torque (`LEAN_G`); the automatic forward lean that stops a wheelie looping over is off while ← is held. 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 are one small code (`inCode(hold, lean)`: bit 0 the gas, bits 1–2 the lean + 1); they 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 gas, 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 gas and flip patterns ahead (`PLANS`: gas pattern, then which arrow to hold for how long after take-off) and steers the bike in the air toward the slope it will land on (`botLevel`); 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). After the arrow-key change all 24 were checked again: the bot still finishes each inside its time target, and a flip-seeking bot reaches every flips target. 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 (`g`: one number per input change, step number × 8 + input code, replayed through the same physics; `gv: 2`. Ghosts without `gv` are from the one-button version, can't replay and are ignored; the next finish of that level saves a new one, and the best time is kept), 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: Gas (Space, up arrow, W; or the mouse, or touch anywhere), Lean back / backflip (←, A), Lean forward / front flip (→, D), Restart (R), Pause (Esc, P). On touch screens two round buttons in the bottom-left (`#lean`, touch only) are the two leans and touching anywhere else is the gas, so both can be held at once; the hint sits above the buttons. Restart is instant; after a crash a press of the gas 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: `advance(n, hold, draw, lean)`, `inputAt(t, hold, lean)`) 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 ` @@ -1088,7 +1120,7 @@

Crashed!

let grainPat=null; // ======================= GAME STATE ======================= -const G={mode:'menu',phase:'idle',tr:null,s:null,prev:null,L:null,lvIndex:-1,seed:0,paused:false,held:false,inQ:[],rt:0,toggles:[], +const G={mode:'menu',phase:'idle',tr:null,s:null,prev:null,L:null,lvIndex:-1,seed:0,paused:false,held:false,inC:2,inQ:[],rt:0,toggles:[], ghost:null,gs:null,cam:{x:0,y:0,z:1,vx:0},demo:false,endAt:0,shown:false,replay:null,rec:[],pops:[],shake:0,flash:0,hint:'',lastEv:[], runCoins:0,custom:null,scarf:null,ear:0,popT:0,crouch:0,lean:0,newBest:false,startT:0}; const theme=()=>THEMES.find(t=>t.id===(G.themeOverride||save.thm))||THEMES[0]; @@ -1429,7 +1461,7 @@

Crashed!

if(mode==='endless'){G.seed=opt.seed!=null?opt.seed:((Date.now()^(Math.random()*1e9))>>>0);G.tr=FL.endless(G.seed);FL.extend(G.tr,320);G.themeOverride=null} else if(mode==='daily'){G.seed=FL.dailySeed();G.tr=FL.endless(G.seed);FL.extend(G.tr,320);G.themeOverride=THEMES[G.seed%THEMES.length].id} else if(mode==='level'){G.lvIndex=opt.i;G.L=LV[opt.i];G.tr=levelTrack(opt.i);G.themeOverride=THEMES[G.L.th].id; - const rec=save.lv[G.L.id];if(rec&&rec.g&&save.set.ghost)G.ghost=rec.g} + const rec=save.lv[G.L.id];if(rec&&rec.g&&rec.gv===2&&save.set.ghost)G.ghost=rec.g} else if(mode==='custom'){G.L={id:'custom',n:TX('Your track'),c:opt.code,f:0,t:0,th:0};G.tr=FL.level(G.L);G.themeOverride=null} else if(mode==='demo'){G.tr=FL.endless(opt.seed||4242);FL.extend(G.tr,320)} restart(); @@ -1437,16 +1469,16 @@

Crashed!

const lvCache={};function levelTrack(i){return lvCache[i]||(lvCache[i]=FL.level(LV[i]))} function restart(){ G.s=FL.newState(G.tr);G.prev=snap(G.s,{});G.phase=G.mode==='demo'?'run':'ready';G.toggles=[];G.inQ.length=0;G.endAt=0;G.shown=false;G.pops.length=0;G.runCoins=0; - G.replay=null;G.rec.length=0;G.newBest=false;G.simHold=false;pnum=0;scarfPts=null;G.combo=0;G.lastFin=null;G.crouch=0;G.lean=0; - G.gs=G.ghost?FL.newState(G.tr):null;if(G.gs)G.gs.noPick=true;G.gk=0;G.gh=false; + G.replay=null;G.rec.length=0;G.newBest=false;G.simIn=FL.inCode(0,0);pnum=0;scarfPts=null;G.combo=0;G.lastFin=null;G.crouch=0;G.lean=0; + G.gs=G.ghost?FL.newState(G.tr):null;if(G.gs)G.gs.noPick=true;G.gk=0;G.gc=FL.inCode(0,0); const s=G.s;G.cam.x=s.x+camLead();G.cam.y=s.y+1.5;G.cam.z=1;G.cam.vx=0; hideAll();if(G.mode!=='demo'){$('hud').hidden=false;$('levelBar').hidden=!G.L;} setHint(G.mode==='demo'?'':readyHint());updateHud(true); AU.song(THEMES.indexOf(theme())); if(G.held&&G.mode!=='demo')beginRun(performance.now()); } -function readyHint(){return touchUI?TX('Touch and hold to ride'):TX('Hold {k} to ride',{k:keyName('go')})} -function beginRun(t){if(G.phase!=='ready')return;G.phase='run';G.rt=t;G.startT=t;G.inQ.push({t,h:G.held});setHint('');AU.S.go()} +function readyHint(){return touchUI?TX('Touch and hold to ride. ◀ ▶ flip'):TX('Hold {k} to ride. {b} {f} to flip',{k:keyName('go'),b:keyName('back'),f:keyName('front')})} +function beginRun(t){if(G.phase!=='ready')return;G.phase='run';G.rt=t;G.startT=t;G.inQ.push({t,c:G.inC});setHint('');AU.S.go()} function camLead(){return Math.min(W/PPM*0.17,5)} function snap(s,o){o.x=s.x;o.y=s.y;o.a=s.a;o.dR=s.dR;o.dF=s.dF;o.t=s.t;return o} @@ -1458,12 +1490,12 @@

Crashed!

if(now-G.rt>250)G.rt=now-250; let n=0;const stepMs=DT*1000; while(G.rt+stepMs<=now&&n<120){ - while(G.inQ.length&&G.inQ[0].t<=G.rt+stepMs){const e=G.inQ.shift();if(e.h!==G.simHold){G.simHold=e.h;if(G.phase==='run'&&!s.crash&&!s.done)G.toggles.push(s.n)}} + while(G.inQ.length&&G.inQ[0].t<=G.rt+stepMs){const e=G.inQ.shift();if(e.c!==G.simIn){G.simIn=e.c;if(G.phase==='run'&&!s.crash&&!s.done)G.toggles.push(s.n*8+e.c)}} if(G.tr.kind==='endless'&&s.n%60===0)FL.extend(G.tr,s.x+220); snap(s,G.prev); - let hold=G.simHold;if(G.mode==='demo')hold=demoHold(s); - FL.step(G.tr,s,hold); - if(G.gs){while(G.gkCrashed! } if(n>=120)G.rt=now; } +// the ghost replays the saved inputs (step number × 8 + input code) through the same physics +function stepGhost(){const g=G.gs;if(!g)return;while(G.gk>3)<=g.n){G.gc=G.ghost[G.gk]&7;G.gk++}FL.step(G.tr,g,FL.inHold(G.gc),FL.inLean(G.gc));g.ev.length=0} function record(s){G.rec.push({x:s.x,y:s.y,a:s.a,dR:s.dR,dF:s.dF,t:s.t,rag:s.rag&&{x:s.rag.x,y:s.rag.y,a:s.rag.a},helm:s.helm&&{x:s.helm.x,y:s.helm.y,a:s.helm.a},crash:s.crash,crashT:s.crashT,hold:s.hold});if(G.rec.length>60*6)G.rec.shift()} // the demo behind the menu: a light version of the test bot -let demoNext=0,demoH=true; -function demoHold(s){if(s.n>=demoNext){demoNext=s.n+30;let best=-1e9;for(const p of[[1,9,1],[0,9,0],[1,0.3,0],[0,0.3,1],[1,0.7,0],[1,1.1,0]]){const c=FL.clone(s);c.noPick=true;let sc=0;const x0=c.x,sw=Math.round(p[1]/DT); - for(let i=0;i<360;i++){FL.step(G.tr,c,ibest){best=sc;demoH=!!p[0]}}} - if(s.crash&&s.t-s.crashT>1.6){newRun('demo',{seed:(Math.random()*1e9)>>>0})}return demoH} +let demoNext=0,demoP=null,demoK=0; +const DEMO_PLANS=[[1,9,1,0,0],[0,9,0,0,0],[1,0.3,0,0,0],[0,0.3,1,0,0],[1,0.7,0,0,0],[1,9,1,-1,0.4],[1,9,1,-1,0.8],[1,9,1,1,0.5]]; +function demoIn(s){if(s.n>=demoNext||!demoP){demoNext=s.n+30;demoK=0;let best=-1e9;for(const p of DEMO_PLANS){const c=FL.clone(s);c.noPick=true;let sc=0;const x0=c.x,sw=Math.round(p[1]/DT); + for(let i=0;i<360;i++){const k=demoCode(c,p,i,sw);FL.step(G.tr,c,FL.inHold(k),FL.inLean(k));if(c.crash){sc=-1000+i;break}}if(!c.crash)sc=c.x-x0+c.st.flips*30+(c.cR||c.cF?0:-Math.abs(FL.wrap(c.a))*6);if(sc>best){best=sc;demoP=p}}} + if(s.crash&&s.t-s.crashT>1.6){newRun('demo',{seed:(Math.random()*1e9)>>>0})}return demoCode(s,demoP,demoK++,Math.round(demoP[1]/DT))} +function demoCode(s,p,i,sw){const h=iCrashed! switch(e.k){ case'touch':{const imp=e.imp||0;const gy=s.y-0.6;dust(s.x,gy,fx()?Math.round(6+imp*3):4,2+imp*0.6,theme().g.lip);AU.S.land(imp+(e.air||0)*2);AU.S.chirp();G.crouch=Math.min(1,0.4+imp*0.12+e.air*0.3); if(fx())G.shake=Math.max(G.shake,Math.min(0.5,imp*0.05+e.air*0.06));G.popT=1;break} - case'bank':{if(e.n>0){const nm=e.n===1?TX('Backflip!'):e.n===2?TX('Double flip!'):e.n===3?TX('Triple flip!'):e.n===4?TX('Quadruple flip!'):TX('{n}× flip!',{n:e.n});pop(nm+' +'+NUM(e.pts),'#fff6e4',true);AU.S.flip(e.n,e.combo)} + case'bank':{if(e.n>0){const nm=e.n===1?(e.back?TX('Backflip!'):TX('Front flip!')):e.n===2?TX('Double flip!'):e.n===3?TX('Triple flip!'):e.n===4?TX('Quadruple flip!'):TX('{n}× flip!',{n:e.n});pop(nm+' +'+NUM(e.pts),'#fff6e4',true);AU.S.flip(e.n,e.combo)} if(e.clean){pop(TX('Clean landing')+(e.combo>1?' ×'+e.mult:''),'#bff3e6',!e.n);AU.S.clean(e.combo);confetti(s.x,s.y,e.n?26:12)} else if(e.air>0.55&&!e.clean&&!e.n){AU.S.sloppy()} if(!e.n&&!e.clean&&e.pts>0)pop(TX('Big air')+' +'+e.pts,'#fff6e4'); @@ -1513,7 +1549,8 @@

Crashed!

let medals=0; if(G.mode==='level'&&s.done){const rec=save.lv[L.id]||(save.lv[L.id]={m:0,t:0,f:0});const old=rec.m|0;let m=old|1; if(st.flips>=L.f)m|=2;if(s.t<=L.t)m|=4; - if(!rec.t||s.trec.f)rec.f=st.flips;rec.m=m;medals=m; for(const b of[1,2,4])if((m&b)&&!(old&b)){medalsNew++;earned+=15} if(medalsNew)AU.S.medal();statsHook('max','medals',medalCount()); @@ -1619,8 +1656,8 @@

Crashed!

groundShadow(G.tr,pose.x,pose.y); const v=veh(),r=rid(); if(s&&!G.replay){const air=!(s.cR||s.cF);G.crouch=Math.max(0,G.crouch-dtReal*2.5);const tuck=air&&s.hold?0.55:0; - G.lean+=((!air&&s.hold&&spd<12?0.6:0)-G.lean)*Math.min(1,dtReal*6);G.popT=Math.max(0,G.popT-dtReal*2.5);G.ear=clamp(spd/16,0,1)} - pose.lean=G.lean;pose.crouch=Math.max(G.crouch,s&&!(s.cR||s.cF)&&s.hold?0.5:0);pose.wr=-(pose.x/P.WR);pose.ear=G.ear; + G.lean+=(clamp((!air&&s.hold&&spd<12&&!s.lean?0.6:0)-(s.lean||0)*0.9,-1,1)-G.lean)*Math.min(1,dtReal*(s.lean?10:6));G.popT=Math.max(0,G.popT-dtReal*2.5);G.ear=clamp(spd/16,0,1)} + pose.lean=G.lean;pose.crouch=Math.max(G.crouch,s&&!(s.cR||s.cF)&&s.lean?0.5:0);pose.wr=-(pose.x/P.WR);pose.ear=G.ear; // scarf: anchor at the neck in world space, then convert to the bike's frame for drawing {const ca=Math.cos(pose.a),sa=Math.sin(pose.a),nx=-0.12,ny=0.86-0.14*pose.crouch;const ax=pose.x+ca*nx-sa*ny,ay=pose.y+sa*nx+ca*ny; scarfStep(ax,ay,(s&&!pose.crash)?s.vx:0,(s&&!pose.crash)?s.vy:0,Math.min(dtReal,0.05)); @@ -1666,38 +1703,46 @@

Crashed!

// ======================= INPUT ======================= const KB=Keybinds.create({game:'flipline',actions:[ - {id:'go',label:'Ride / flip',note:'Hold on the ground to ride, hold in the air to flip',group:'Ride',keys:['Space','ArrowUp','KeyW']}, + {id:'go',label:'Gas',note:'Hold to ride, let go to coast',group:'Ride',keys:['Space','ArrowUp','KeyW']}, + {id:'back',label:'Lean back / backflip',note:'In the air: spin backwards. On the ground: wheelie',group:'Ride',keys:['ArrowLeft','KeyA']}, + {id:'front',label:'Lean forward / front flip',note:'In the air: spin forwards. On the ground: lean over the bars',group:'Ride',keys:['ArrowRight','KeyD']}, {id:'restart',label:'Restart',group:'Ride',keys:['KeyR']}, {id:'pause',label:'Pause',group:'Ride',keys:['Escape','KeyP']}],classes:{button:'btn sm',primary:'btn clay sm'}}); function keyName(a){try{return KB.short(a)}catch(e){return a}} -const keys=new Set();let ptrs=new Set(); +const keys=new Set();let ptrs=new Set();const leanPtrs=new Map(); // leanPtrs: touch pointer → -1 back / 1 forward (the on-screen lean buttons) function computeHeld(){return KB.held('go',keys)||ptrs.size>0} -function inputChanged(t){const h=computeHeld();if(h===G.held)return;G.held=h;AU.resume(); - if(G.replay){if(h){G.replay=null;setHint('');$('results').hidden=false}return} +function computeLean(){let b=KB.held('back',keys),f=KB.held('front',keys);for(const d of leanPtrs.values()){if(d<0)b=true;else f=true}return b&&!f?-1:f&&!b?1:0} +function inputChanged(t){const h=computeHeld(),l=computeLean(),c=FL.inCode(h,l);if(c===G.inC)return;const pressed=h&&!G.held;G.held=h;G.inC=c;AU.resume(); + if(G.replay){if(pressed){G.replay=null;setHint('');$('results').hidden=false}return} if(G.mode==='demo')return; - if(h&&G.shown){restartSame();return} - if(h&&G.phase==='ready'&&!G.paused&&overlaysClosed()){beginRun(t)} - if(G.phase==='run')G.inQ.push({t,h}); + if(pressed&&G.shown){restartSame();return} + if(pressed&&G.phase==='ready'&&!G.paused&&overlaysClosed()){beginRun(t)} + if(G.phase==='run')G.inQ.push({t,c}); // after a crash a fresh press goes straight back to the start (the run is still scored); a finished level shows its card - if(h&&G.s&&G.s.crash&&!G.shown&&G.s.t-G.s.crashT>0.3){endRun(true);restartSame();return} - if(h&&G.s&&G.s.done&&!G.shown&&G.s.doneT>0.4){endRun()} + if(pressed&&G.s&&G.s.crash&&!G.shown&&G.s.t-G.s.crashT>0.3){endRun(true);restartSame();return} + if(pressed&&G.s&&G.s.done&&!G.shown&&G.s.doneT>0.4){endRun()} } function overlaysClosed(){return['menu','levels','garage','chal','settings','editor','pause'].every(id=>$(id).hidden)} addEventListener('keydown',e=>{ if(KB.busy())return;if(e.target&&(e.target.tagName==='INPUT'||e.target.tagName==='TEXTAREA'))return; const acts=KB.actionsFor(e.code); - if(acts.includes('go')){if(!overlaysClosed())return;e.preventDefault();if(e.repeat)return;keys.add(e.code);inputChanged(e.timeStamp||performance.now());return} + if(acts.includes('go')||acts.includes('back')||acts.includes('front')){if(!overlaysClosed())return;e.preventDefault();if(e.repeat)return;keys.add(e.code);inputChanged(e.timeStamp||performance.now());return} if(acts.includes('restart')&&G.mode!=='menu'&&G.mode!=='demo'&&overlaysClosed()){e.preventDefault();AU.resume();if(G.replay){G.replay=null}if(G.s&&(G.s.crash||G.s.done)&&!G.shown)endRun(true);restartSame();return} if(acts.includes('pause')||e.code==='Escape'){e.preventDefault();if(!$('pause').hidden)resume();else if(G.mode!=='demo'&&G.mode!=='menu'&&overlaysClosed()&&!G.shown)pause();else if(e.code==='Escape')backFromOverlay();return} if(e.code==='Backquote'&&TEST)G.dbg=!G.dbg; }); -addEventListener('keyup',e=>{keys.delete(e.code);if(KB.is('go',e.code))inputChanged(e.timeStamp||performance.now())}); -addEventListener('blur',()=>{keys.clear();ptrs.clear();inputChanged(performance.now());if(G.phase==='run'&&!G.shown&&G.mode!=='demo')pause()}); +addEventListener('keyup',e=>{keys.delete(e.code);if(KB.is('go',e.code)||KB.is('back',e.code)||KB.is('front',e.code))inputChanged(e.timeStamp||performance.now())}); +addEventListener('blur',()=>{keys.clear();ptrs.clear();leanPtrs.clear();inputChanged(performance.now());if(G.phase==='run'&&!G.shown&&G.mode!=='demo')pause()}); document.addEventListener('visibilitychange',()=>{if(document.hidden){AU.suspend(true);if(G.phase==='run'&&!G.shown&&G.mode!=='demo')pause()}else if(!G.paused)AU.suspend(false)}); cv.addEventListener('pointerdown',e=>{e.preventDefault();ptrs.add(e.pointerId);try{cv.setPointerCapture(e.pointerId)}catch(_){}inputChanged(e.timeStamp||performance.now())}); const up=e=>{if(ptrs.delete(e.pointerId))inputChanged(e.timeStamp||performance.now())}; cv.addEventListener('pointerup',up);cv.addEventListener('pointercancel',up);cv.addEventListener('lostpointercapture',up); cv.addEventListener('contextmenu',e=>e.preventDefault()); +// the on-screen lean buttons (touch screens only): hold ◀ to lean back / backflip, ▶ to lean forward / front flip +document.querySelectorAll('#lean button').forEach(b=>{const d=+b.dataset.lean; + b.addEventListener('pointerdown',e=>{e.preventDefault();e.stopPropagation();leanPtrs.set(e.pointerId,d);b.classList.add('on');try{b.setPointerCapture(e.pointerId)}catch(_){}inputChanged(e.timeStamp||performance.now())}); + const off=e=>{if(leanPtrs.delete(e.pointerId)){if(![...leanPtrs.values()].includes(d))b.classList.remove('on');inputChanged(e.timeStamp||performance.now())}}; + b.addEventListener('pointerup',off);b.addEventListener('pointercancel',off);b.addEventListener('lostpointercapture',off);b.addEventListener('contextmenu',e=>e.preventDefault())}); // tapping the results backdrop (not its buttons) goes again $('results').addEventListener('pointerdown',e=>{if(e.target===$('results')){e.preventDefault();ptrs.add(e.pointerId);inputChanged(e.timeStamp||performance.now())}}); $('results').addEventListener('pointerup',up); @@ -1724,7 +1769,7 @@

Crashed!

$('setBtn').onclick=()=>{AU.resume();AU.S.ui();menuFrom='menu';openSettings()}; $('pauseBtn').onclick=e=>{e.stopPropagation();AU.S.ui();if(G.shown)return;pause()}; $('pResume').onclick=()=>{AU.S.ui();resume()};$('pRestart').onclick=()=>{AU.S.ui();G.paused=false;restartSame()};$('pMenu').onclick=()=>{AU.S.ui();toMenu()}; -function pause(){if(G.mode==='demo'||G.mode==='menu')return;G.paused=true;keys.clear();ptrs.clear();G.held=false;if(G.phase==='run')G.inQ.push({t:performance.now(),h:false}); +function pause(){if(G.mode==='demo'||G.mode==='menu')return;G.paused=true;keys.clear();ptrs.clear();leanPtrs.clear();document.querySelectorAll('#lean button').forEach(b=>b.classList.remove('on'));G.held=false;G.inC=FL.inCode(0,0);if(G.phase==='run')G.inQ.push({t:performance.now(),c:G.inC}); $('pMusic').value=save.set.mus;$('pSfx').value=save.set.sfx;hideAll();$('pause').hidden=false;$('hud').hidden=false} function resume(){$('pause').hidden=true;G.paused=false;G.rt=performance.now();$('hud').hidden=false} function openLevels(){ @@ -1829,14 +1874,14 @@

Crashed!

} // test hooks (only for automated browsers) if(TEST)window.__fl={FL,G,get save(){return save},set save(v){save=v},persist,loadSave,newRun,restart,toMenu,endRun,startReplay,THEMES,VEH,RID,CH,openGarage,openLevels,openChal,openSettings,openEditor, - inputAt(t,h){if(h&&G.phase==='ready')beginRun(t);if(G.phase==='run')G.inQ.push({t,h})},simulate,render:(n)=>render(n,1/60),setTheme(id){G.themeOverride=id;bgCache=null},popsClear(){G.pops.length=0}, + inputAt(t,h,l){G.held=!!h;G.inC=FL.inCode(h,l);if(h&&G.phase==='ready')beginRun(t);if(G.phase==='run')G.inQ.push({t,c:G.inC})},simulate,render:(n)=>render(n,1/60),setTheme(id){G.themeOverride=id;bgCache=null},popsClear(){G.pops.length=0}, setHeld(h){G.held=h}, // manual stepping for frame strips: n physics steps with the button held or not, then one drawn frame - advance(n,hold,draw){G.manual=true;if(G.phase==='ready')G.phase='run';const s=G.s;for(let i=0;i=0&&s.t-G._airAt=0&&s.t-G._airAtFlipline
-

A side-on stunt bike game in cut paper. Hold to ride; in the air the same hold tips you over backwards. Let go at the right moment, land on your wheels, and chain clean landings into a combo while ramps, gaps, see-saws, swinging spiked balls, saws and crushers try to stop you.

+

A side-on stunt bike game in cut paper. Hold to ride and flip with the arrow keys, backwards or forwards. Gravity is on, so steer the bike round to land on your wheels, and chain clean landings into a combo while ramps, gaps, see-saws, swinging spiked balls, saws and crushers try to stop you.

  • Endless, on a course that keeps building itself (every stretch is checked to be rideable), and a Daily run with the same course for everyone
  • 24 levels in four tiers, each with three medals: finish, flips and time, plus a ghost of your best run
  • diff --git a/e63334287a3deaa3/news-es.js b/e63334287a3deaa3/news-es.js index 1087ae06..ed2aecc2 100644 --- a/e63334287a3deaa3/news-es.js +++ b/e63334287a3deaa3/news-es.js @@ -6,6 +6,12 @@ (function () { if (!window.BackRoomLang) return; BackRoomLang.add({ + "Flipline: flip with the arrows": "Flipline: gira con las flechas", + "Flips are on the arrow keys now: hold ← to spin backwards and → to spin forwards, so front flips are a real trick. Space, the up arrow or the mouse is just the gas.": "Ahora los giros van con las flechas: mantén ← para girar hacia atrás y → para girar hacia adelante, así que los mortales hacia adelante son un truco de verdad. Espacio, la flecha arriba o el mouse solo aceleran.", + "Gravity is on: nobody levels the bike for you in the air any more. A spin keeps going until you stop it and the heavy front end drops the nose, so steer with the arrows to land on your wheels.": "Hay gravedad: ya nadie endereza la moto por ti en el aire. Un giro sigue hasta que lo frenas y el peso de adelante hace caer la trompa, así que corrige con las flechas para aterrizar sobre las ruedas.", + "On the ground the arrows pop a wheelie or lean you over the bars.": "En el suelo, las flechas te hacen levantar la rueda delantera o inclinarte sobre el manubrio.", + "On a phone, two round buttons in the bottom-left corner spin you back and forward; touch anywhere else for gas.": "En el teléfono, dos botones redondos abajo a la izquierda te hacen girar hacia atrás y hacia adelante; toca en cualquier otro lugar para acelerar.", + "Every level can still be finished with all three medals. Level ghosts saved before today can't replay with the new controls, so your next finish of each level saves a new one (your best times stay).": "Todos los niveles se pueden seguir terminando con las tres medallas. Los fantasmas de nivel guardados antes de hoy no se pueden repetir con los controles nuevos, así que tu próxima vez que termines cada nivel se guarda uno nuevo (tus mejores tiempos se mantienen).", "Install the site as an app": "Instala la web como una app", "You can now install the site as an app in Chrome (and Edge, and Chrome on Android): open the home page and click Install app under the intro, or the install icon at the right of the address bar.": "Ahora puedes instalar la web como una app en Chrome (y en Edge, y en Chrome para Android): abre la página principal y haz clic en «Install app» debajo de la presentación, o en el icono de instalar a la derecha de la barra de direcciones.", "It opens in its own window with its own icon, like any other app on your computer, and you can pin it to the taskbar or dock.": "Se abre en su propia ventana con su propio icono, como cualquier otra app de tu ordenador, y puedes anclarla a la barra de tareas o al Dock.", diff --git a/e63334287a3deaa3/news.js b/e63334287a3deaa3/news.js index 7c00bedb..07c56ac1 100644 --- a/e63334287a3deaa3/news.js +++ b/e63334287a3deaa3/news.js @@ -85,6 +85,14 @@ */ (function () { var NEWS = [ + {date: '2026-11-20', version: '1.38', title: 'Flipline: flip with the arrows', kind: 'feature', + tags: ['Flipline'], img: 'm/thumbs/flipline.jpg', items: [ + 'Flips are on the arrow keys now: hold ← to spin backwards and → to spin forwards, so front flips are a real trick. Space, the up arrow or the mouse is just the gas.', + 'Gravity is on: nobody levels the bike for you in the air any more. A spin keeps going until you stop it and the heavy front end drops the nose, so steer with the arrows to land on your wheels.', + 'On the ground the arrows pop a wheelie or lean you over the bars.', + 'On a phone, two round buttons in the bottom-left corner spin you back and forward; touch anywhere else for gas.', + 'Every level can still be finished with all three medals. Level ghosts saved before today can\'t replay with the new controls, so your next finish of each level saves a new one (your best times stay).' + ]}, {date: '2026-11-20', version: '1.37', title: 'Install the site as an app', kind: 'feature', items: [ 'You can now install the site as an app in Chrome (and Edge, and Chrome on Android): open the home page and click Install app under the intro, or the install icon at the right of the address bar.',