diff --git a/README.md b/README.md index 77a00330..874e8b5f 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the - `e63334287a3deaa3/asteroid-run/`: Asteroid Run (Back Room), a fast single-player runner through tunnels of tiles floating in space (Three.js, no Firebase except stats.js). It is deliberately simple and flat to look at: every tile is one flat colour with a thin lighter outline (one tunnel colour per zone, set in `THEMES`; special tiles have their own colours in `TCOL`), holes show the plain dark starfield behind, the runners are flat cartoon sprites seen from behind (drawn on a canvas, three frames: two running steps and one in the air), crystals are flat spinning diamonds, and there are no lights or shading: everything uses `MeshBasicMaterial` (the tiles add a few lines in `onBeforeCompile` to turn the outline mask into a lighter edge, dimmer for a tile left in the dark), so a wall looks exactly the same once it turns into the floor. You run forward on your own and only sidestep and jump; running off the side of the floor takes you up the wall and gravity turns with you, so the wall becomes the floor (the main trick: a wall is often the way round a hole). A soft dark spot under the runner shows where it will land (none over a hole). Everything that isn't drawing is the `AR` module between `// ==CORE==` and `// ==/CORE==`, with no DOM or Three.js in it, so a test can run it on its own: the runners (`CHARS`), tile types (`T`), the levels (`LEVELS`), the zones and side tunnels (`ZONES`, `SIDES`, which also build the map `MAP` and `PRED`), the endless tunnel (`buildEndless`, `extendEndless`, `ENDZ`), the fixed 1/120 s physics step (`step`), the camera (`camStep`) and the checking bot (`plan`, `runBot`). **Jumping**: by default a tap is a small hop (about 1 m high, 4 rows long) and holding jump makes it bigger, smoothly, up to the runner's full jump once held for about a quarter of a second; letting go early only makes gravity firmer, so nothing drops suddenly. `jumpArc` works out the take-off speed and the two gravities from the running speed so the full jump is always exactly `jl` long and `jh` high (10.5 m, 7 tiles, and 2.5 m for most runners; Moppet 12.5 m and 3.3 m) and a tap is `TAP` (0.4) of the height. The Settings option Jump: Always full (`asteroid-run:set` `fixed`) makes every jump the full one, whatever the hold. A jump still works for `COYOTE` s after running off an edge, a press up to `JBUF` s before landing jumps on landing, landing just short of a tile still steps you up onto it, and in a narrow tunnel the far wall is a ceiling you bump into (`headroom`). Speed rises by a tenth from the start to the end of each level (`speedAt`); Endless goes from 1x to 1.5x over its first 2 km (`endlessSpeed`). **Runners** (each with one fixed full jump; `free`: how it unlocks for nothing, `cost`: crystals to unlock it straight away): Pip (all-rounder, free), Brick (heavy: cracked tiles never give way; 6 levels), Vex (fastest, slippery; clear the Frostbelt side tunnel), Moppet (biggest jump; 18 levels), Twitch (quickest sidestep and a double jump; clear Comet Tail), Wisp (hold jump on the way down to float for up to `GLIDE_T` s; clear Deep Hush), Clink (crystal magnet; 30 levels) and Spool (the Ability key or button lays a glowing bridge over the holes ahead for `BRIDGE_T` s, recharging in `BRIDGE_CD` s; 42 levels). **Tiles** (`T`): normal, cracked (they hold while you keep running but give way 0.3 s after you step on, almost at once if you land on one, and visibly fall away), ice, conveyors left/right/forward/back, ramps (a launch 1.6 times as long and 1.3 times as high, always the full jump; drawn as a lime wedge), sticky goo, speed strips (1.3 times the speed for 1.5 s, and the view widens), glow tiles (always lit) and Spool's bridges (`W.br`, never in the rows). Dark rows (`W.dk`, from `D1`/`D0` in a level) are drawn almost black except from just behind the runner to `LIT` (14) rows ahead, so the next tiles are always visible. **Levels**: 57 (indexes never change, since saved progress is keyed by them; the first 32 are the original levels, lengthened, and 32 on were added later), each 20 to 40 s with any runner, built from a line of pieces (the comment above `LEVELS` lists them) and a fixed seed, so every player gets the same level. Shapes (`SHAPES`): square, six-sided, eight-sided, narrow square, wide eight-sided, a thin six-sided pipe, three-sided and five-sided. They're grouped into ten zones on the main path, each teaching one idea (holes, walls, crumbling tiles, a mixed Junction, narrow tunnels, conveyors, speed strips, ramps, the dark, and the Core finale), with a fork in most zones (either level opens what's next) and three harder side tunnels (Frostbelt: ice, Comet Tail, Deep Hush), each of which frees a runner. The map is a big scrolling picture (drawn top to bottom on a tall phone); levels are named by zone and place (`2-3`) or side tunnel letter (`F2`). The first time a zone is played, Dispatch (the radio voice of the little story: the quake put the asteroid's lights out and you carry the last spark home) says a line or two (`say`), and the map can show it again. Falling 2.2 m below the wall (`DEATH_H`) is a fall into space: the camera holds still while the runner tumbles away for a moment, then you're straight back at the start (tries are counted, no limit). **Endless** is seeded per run (the Daily run uses a seed from the date, so everyone gets the same tunnel all day) and changes zone every `ENDZ_LEN` (360) m, with the zone's colour and hazards (`ENDZ`: holes, crumbling, conveyors, speed strips and ramps, ice, the dark, everything); crystals come in short lines, and picking them up quickly builds a streak (every fifth in a streak gives one more crystal). After a fall the score shows at once; Space, Enter, R or a tap outside the card runs again, and once a run you can spend 15 crystals to carry on from the next solid ring (`respawn`). **Crystals**: each level's three once each, plus everything from Endless; spent on runners and on cosmetic trails (`TRAILS`). After changing a level or the physics, run the bot (`AR.runBot(AR.buildLevel(i), AR.CHARS[k])` in Node, or `__ar.autopilot(true)` with `__ar.advance(seconds)` in an automated browser, where `window.__ar` exists): every level should be cleared by every runner, and pieces like a face piece need room before them (see the comment above `LEVELS`). Drawing: one `InstancedMesh` for all tiles (colour per instance), one each for conveyor arrows, chevrons, cracks, goo, ramps, bridges and falling tiles (only drawn when there are any), one for crystals, the runner, its shadow, the sparks, the stars and the finish frame, so a frame is about 6 to 14 draw calls; tiles are rebuilt only when you move onto a new row. On computers a demo runner (the bot) runs the endless tunnel behind the menu; on touch screens the menu shows a still tunnel. The HUD is three small pills (pause, progress or distance, crystals), a bridge meter for Spool, and short pop-ups for streaks and close calls (jumping off the very end of a tile, landing on its edge). Saved in the browser only: `asteroid-run:save` (`{v: 2, lv: {: {c: crystal bits, t: best time, n: clears}}, bank: crystals kept from Endless, ch: runner, best: Endless metres, runs, own: runners unlocked with crystals, spent: crystals spent, trail, trails, bestBy: {runner: Endless metres}, daily: {day, best}, seen: {zone: 1}}`; a v1 save keeps its levels and crystals, every runner the old rules had unlocked, and its Endless best for the runner it had picked), `asteroid-run:set` (sound, graphics, touch layout, `fixed`) and keys under `keybinds:asteroid-run`. Stats hooks: `max('levels', levels cleared)`, `max('crystals', crystals collected in total)`, `max('distance', metres)` and `max('dist-', metres)` at the end of an Endless run, `add('runs', 1)` for each level cleared and each Endless run. Touch: arrow buttons bottom left and a jump button bottom right (hold it for a bigger jump), Spool's bridge button above it, or (Settings, Touch: Screen halves) hold either half of the screen to sidestep. **Wardrobe** (hidden: captains only for now): aliens to run as, run trails and tunnel colours, all drawn in code by `wardrobe.js` beside the page, which the page fetches (with `../cosmetics.js`, for the names: `GAMES['asteroid-run']`, slots `alien`, `trail` and `tunnel`) only when `wardrobeOn()` is true: `ASTEROID_PUBLIC` (the one line that opens it to everyone; `false` now), a captain (`../captains.js`), or `?wardrobe=1` on localhost or in an automated browser (remembered for the tab; `?wardrobe=0` forgets it). For everyone else nothing more is fetched or shown and the game draws exactly as before. A captain gets a Wardrobe button in the menu (above Settings and help) and every item free to wear. The 39 aliens (20 of them added in November 2026: alien athletes with shirt numbers on the back, two robot aliens, space pirates with eye patches, and aliens in suits, a fedora, a fur hat and a tuxedo, all on one shared round-headed body, `kid()` in `wardrobe.js`) are each drawn from behind in three frames, like the runners, for the game, and from the front for the Wardrobe; an alien only replaces the runner's picture, on the same plane at the runner's own size, and the physics never looks at the picture, so the hit area, speed, jump and ability stay the runner's. The 10 run trails are small flat shapes (stars, drips, bubbles, hearts, confetti, pixels, snowflakes, petals, sparks, rings) in their own `Points` object (one draw call, only while any are alive; the shader cuts the shapes out), dropped only while the runner is moving and always slower than it, so they never go ahead of it; worn, one replaces the crystal trail. The 10 tunnel colours change the plain tiles only (special tiles, holes, the dark and the sky stay as they are), and `wardrobe.js` checks each colour zone by zone before using it: a hole must stand out at least as much as in the worst default zone (contrast 4.31 against the zone's sky), and every special tile that zone uses must be at least 0.15 away from it in OKLab (the default zone colours go down to 0.099, The Core against goo); a colour that fails gives way to the next in the tunnel's list, and a zone with none left keeps its own colour (Candy Checker in Drift Docks). `__ar.WR.audit(n)` gives a tunnel's worst case. Worn items are saved as `asteroid-run:look` (`{a, t, u}`, item numbers from `cosmetics.js`, 0 for none); the game has no online players, so nothing is sent anywhere. **Spanish:** it loads `../lang.js` and its own words in `asteroid-run/es.js` (level, zone and runner names stay English; Dispatch's lines, menus, the map and the Wardrobe are translated); text in the SVG map and canvases goes through `TX()` (not `T`, which is the tile list here), the runner panel and map are rebuilt on a language change, and there is an EN | ES switch next to Controls. Wardrobe item names come from `../cosmetics.js` and stay English. - `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 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 ` + + +Flipline + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + diff --git a/e63334287a3deaa3/flipline/preview.jpg b/e63334287a3deaa3/flipline/preview.jpg new file mode 100644 index 00000000..4626060d Binary files /dev/null and b/e63334287a3deaa3/flipline/preview.jpg differ diff --git a/e63334287a3deaa3/index.html b/e63334287a3deaa3/index.html index a87bef0f..bda1f355 100644 --- a/e63334287a3deaa3/index.html +++ b/e63334287a3deaa3/index.html @@ -155,6 +155,33 @@

Rampline

+
+ + Flipline in play in a cut-paper desert canyon at golden hour: a rider in a teal jacket and a blue scarf turns a backflip on an orange dirt bike high above a sandy ramp, coins hang in the air ahead, and layered paper mesas, clouds and a low sun fill the sky. Distance, score and coins sit along the top. + NewStunt bike + +
+

Flipline

+

One button: hold to ride, hold in the air to flip, land it clean.

+
  • Solo
  • 24 levels
  • Endless
+
+ +
+

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.

+
    +
  • 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
  • +
  • 40 rotating challenges, and coins from playing that unlock 12 vehicles, 8 riders and 6 places (all ride the same), plus 3 secret vehicles
  • +
  • A track editor with share codes, and a slow-motion replay of your crash
  • +
+

One button: Space (rebindable), the mouse, or touch anywhere. Works either way up on a phone.

+
+
+
+ ▶ Play +
+
+
Rumble Karts on the Lava Foundry map: a pink kart with a spike shield drives between two lava pools toward rival karts and smokestacks, with a leaderboard, round timer and minimap on screen. diff --git a/e63334287a3deaa3/leaderboard.js b/e63334287a3deaa3/leaderboard.js index 6ec181f5..e2c26ada 100644 --- a/e63334287a3deaa3/leaderboard.js +++ b/e63334287a3deaa3/leaderboard.js @@ -119,7 +119,7 @@ 'Towers climbed': 'Torres escaladas', 'Fastest full run (all 25 levels)': 'Recorrido completo más rápido (los 25 niveles)', 'Fastest full run': 'Recorrido completo más rápido', 'Most stars': 'Más estrellas', 'Levels cleared (all time)': 'Niveles superados (histórico)', 'Levels cleared': 'Niveles superados', 'Best height': 'Mayor altura', 'Fastest to the Crown (3000 m)': 'Más rápido a la Corona (3000 m)', 'The Crown': 'La Corona', 'Fastest to the old summit (1000 m)': 'Más rápido a la vieja cumbre (1000 m)', 'Old summit': 'Vieja cumbre', - 'Longest Endless run': 'Carrera infinita más larga', 'Power crystals collected': 'Cristales de poder juntados', 'Runs (all time)': 'Carreras (histórico)', + 'Longest Endless run': 'Carrera infinita más larga', 'Best Endless score': 'Mejor puntaje en Infinito', 'Medals (of 72)': 'Medallas (de 72)', 'Power crystals collected': 'Cristales de poder juntados', 'Runs (all time)': 'Carreras (histórico)', 'Most props found in a round': 'Más objetos encontrados en una ronda', 'Longest survival as a prop': 'Más tiempo sobreviviendo como objeto', 'Props found (all time)': 'Objetos encontrados (histórico)', 'Most crowns in a row': 'Más coronas seguidas', 'Shows played': 'Shows jugados', 'Answers given (all time)': 'Respuestas dadas (histórico)', 'Longest answer streak': 'Racha de respuestas más larga', 'Lines cleared (all time)': 'Líneas borradas (histórico)', 'Biggest tile': 'Ficha más grande', 'Most lines': 'Más líneas', 'Watermelons grown (all time)': 'Sandías logradas (histórico)', @@ -268,6 +268,11 @@ { k: 'r2-freefall', l: '28. Freefall', chip: 'Freefall', f: 'time', lo: 38.7, hi: 3600 }, { k: 'r2-afterburner', l: '29. Afterburner', chip: 'Afterburner', f: 'time', lo: 29.9, hi: 3600 }, { k: 'r2-final-exam', l: '30. Final Exam', chip: 'Final Exam', f: 'time', lo: 34.8, hi: 3600 }] }, + { d: 'flipline', n: 'Flipline', st: [ + { k: 'distance', l: 'Longest Endless run', chip: 'Endless', f: 'm', hi: 100000 }, + { k: 'score', l: 'Best Endless score', chip: 'Score', f: 'n', u: 'pt', hi: 1e7 }, + { k: 'medals', l: 'Medals (of 72)', chip: 'Medals', f: 'n', u: 'medal', hi: 72 }, + { k: 'runs', l: 'Runs (all time)', chip: 'Runs', f: 'n', u: 'run', rate: 1 / 8 }] }, { d: 'tidewick', n: 'Tidewick', st: [{ k: 'score', l: 'Best score', f: 'n', u: 'pt', hi: 999999 }] }, { d: 'odd-one-out', n: 'Odd One Out', st: [{ k: 'elo', l: 'Elo', f: 'elo', lo: 100, hi: 3000 }, { k: 'rfound', l: 'Most props found in a round', f: 'n', u: 'prop', hi: 15, le: 'found' }, diff --git a/e63334287a3deaa3/m/index.html b/e63334287a3deaa3/m/index.html index 960e2cd3..5f493e74 100644 --- a/e63334287a3deaa3/m/index.html +++ b/e63334287a3deaa3/m/index.html @@ -184,6 +184,7 @@

Arjun's games

['slipstream','Slipstream','22-car open-wheel races. Draft, brake late, pass.',1], ['boostball','Boostball','Rocket-car soccer with a giant ball.',1], ['rampline','Rampline','Stunt time trials, online boards and a track builder.',1], + ['flipline','Flipline','One-button stunt bike: hold to ride, hold in the air to flip.',1], ['rumble-karts','Rumble Karts','Three-minute kart brawls with weapons.',1] ],'cars'], ['Shoot, build and outlast',[ diff --git a/e63334287a3deaa3/m/thumbs/flipline.jpg b/e63334287a3deaa3/m/thumbs/flipline.jpg new file mode 100644 index 00000000..acad6afe Binary files /dev/null and b/e63334287a3deaa3/m/thumbs/flipline.jpg differ