diff --git a/README.md b/README.md index b2557651..fc8eed0f 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the - `e63334287a3deaa3/flickerwood/`: Flickerwood (Back Room), an 8-bit maze chase for one player (one file, one canvas, Web Audio, no libraries, no Firebase except stats.js). Glim, a firefly, gathers every speck of pollen in a moonlit hedge maze (a glade) while four night critters come out of the hollow stump in the middle and chase its light. It is our own take on the maze-chase genre: the name, theme, characters, mazes, art, sounds, words and numbers are all ours, and only the genre's ideas are used. **The four critters** never find a path: at the middle of every tile each one picks the open way (never straight back) whose next tile is nearest, in a straight line, to the tile it wants (`target()`), and all of its character is in that tile. Swoop the bat wants Glim's tile; Gulp the frog wants the tile 3 ahead of the way Glim faces (`AHEAD`); Tangle the spider wants the point on the far side of Glim from Swoop (twice Glim's tile minus Swoop's); Dither the moth wants Glim while more than 5 tiles away (`NEAR`) and its own corner once closer. They take turns at two moods on a clock: **roost** (each heads for its own corner: Swoop top right, Gulp top left, Tangle bottom right, Dither bottom left) and **hunt**; every time the mood changes they all turn straight round, which is the tell. Glim is faster than they are in an empty corridor and a little slower while eating, turns can be pressed early and are remembered until the next gap, a turn started up to 4 pixels before the middle of a tile cuts the corner and gains those pixels (`CUT`; up to 3 pixels late it is still taken, `LATE`), and a reverse is taken anywhere. A **moonbloom** (four a glade) dazzles the critters: they turn round, go pale, slow to 60% and mostly run away, and touching one sends it home as a puff of dust for 100, 250, 500 then 1000 (`CATCH`); they flicker for the last 2 seconds, and a caught one rests 1.2 s in the stump and comes back out as itself. **Tunnels** at the edges (`~` tiles) wrap round and slow critters to 55%. A **find** (dewdrop, acorn, clover, toadstool, bluebell, feather, snail shell, moonstone, one kind a glade) shows under the stump for 9 s when 35% and again when 70% of the glade is eaten, worth 200 plus 100 a glade up to 1000. Our own twists: **Dash** (0.32 s at 2.1 times speed, then 6 s to recharge, shown as a meter) and the **chain** (each speck eaten within 1 s of the last carries it on; every 12 raises the multiplier on specks, up to 5 times). Specks are 5, moonblooms 30, clearing a glade 100 times its number up to 1000 plus 300 if no life was lost in it; 3 lives, one more at 6,000 and every 15,000 after, 5 at most. **Rules** live between `// ==RULES==` and `// ==END RULES==`: no page, clock, sound or `Math.random` in there, so the same seed and presses always give the same game (`create(seed)`, `startGame(g)`, `step(g, 1/120)`, `turn(g, d)` with d 0 right, 1 down, 2 left, 3 up, and `dash(g)`; what should be heard or shown goes into `g.ev` as words, and eaten tiles into `g.gone`). Positions in the rules are maze pixels; the page adds the score bar above. Glim and the critters are a tile, a direction and how far along it they are (`c, r, dir, off`), so they can never leave a path; they touch when both gaps are under 7 pixels (`HIT`, smaller than the sprites). **Glades** are the five `MAZES` at the top of the rules, drawn by hand as 23 rows of 21 letters (12-pixel tiles): `#` hedge, `.` pollen, `o` moonbloom, `-` path, `~` tunnel, `HHH` the stump with `G` its gate above the middle, `P` Glim's start, `B` the find, space outside the glade. Hedge Court is a full rectangle with a tunnel across the middle, Lily Pond has its corners cut off and tunnels top to bottom, Bramble Wheel is not mirrored (its bottom half is its top half turned half round) and has two tunnels, Mossy Ruin has tunnels both ways through the middle of each edge, and Moth Hollow is an hourglass with none; glade 6 is Hedge Court again, quicker. A new or changed glade must stay: every path one tile wide (no open 2 × 2), no dead ends, all joined up, a border tile that is a path matched on the opposite border, the start at least 8 steps from the gate with a way left and right (Glim sets off left), one moonbloom in each quarter, nothing but hedge next to the outside. A script checked all of that for the five glades when they were made (it is not in the repo), so check again by hand if you change one. **Tuning** is `tune(level)` and the constants at the top of the rules: Glim 66 pixels a second plus 1.3 a glade; critters 70% of that plus 3 points a glade (97% at glade 10); the dazzle 8 s less 0.67 s a glade, never under 2; roosts of 7, 7, 5 and 4 s (less 0.55 s a glade, never under 1.5) between hunts of 13, 15 and 18 s (plus 1.2 s a glade), then hunting for good; Gulp leaves the stump after 3 s, Tangle after 12 s or 30 specks, Dither after 28 s or 90 specks, all sooner glade by glade; from glade 3 Swoop speeds up 6% when 20% of the pollen is left and 12% under 8%, and keeps hunting through roosts; nothing tightens after glade 10 (`TOP_LEVEL`). Glade 1 is meant to be cleared by a first-time player: a test bot that only heads for the nearest pollen and runs when something is three tiles away clears it nearly every time. **Drawing**: the game is a 252 × 300 picture (a 14-pixel score bar, the 252 × 276 maze, a 10-pixel strip for spare lives, the dash meter and finds). `layout()` shows it at a whole number of device pixels per game pixel, so pixels stay square and sharp, and tries three places for it, biggest picture first: under the top bar with the key hint, under the bar without the hint, and between the bar's title and buttons (so a 1366 × 768 laptop with a short browser window still gets 2 ×); only when a whole number would be 1 is it drawn at 2 and shrunk smoothly to fit. Never size the canvas with CSS percentages or `vh`. Sprites are rows of letters turned into small canvases once (`bake`; Glim is drawn facing right and turned for the other three ways; two frames each; the dazzled look is the same shapes in two pale tones); the hedges, stump and tunnel marks are drawn once per glade (`mazeL`, and a lit copy `flashL` for the blink when a glade is cleared), the pollen sits on its own layer and each speck is wiped from it as it is eaten, the score bar is redrawn only when something on it changes, and words use a 5 × 5 pixel alphabet drawn in code (capitals, digits and `+ - : ! .` only). The loop runs the rules in fixed steps of 1/120 s and draws between steps. It pauses when the tab is hidden or the window loses focus. **Sound** is made in the page: square, triangle and noise blips in `SFX`, and a 16-bar tune of our own in A minor in `TUNE` (notes as numbers), booked a tenth of a second ahead on the audio clock; while a moonbloom is on, a quicker bright figure plays instead. Nobody has listened to it yet, so the loudness and the tune want a check by ear. **Saved in the browser only**: `flickerwood-best` (score), `flickerwood-glade` (furthest glade), `flickerwood-mute` (in try/catch), keys under `keybinds:flickerwood`. Stats hook: `max('score', score)` and `max('glade', glade reached)` when a glade is cleared and at game over (the Leaderboards show best score). Controls: arrows or WASD turn, Space or Shift dashes, P, Enter or Esc pause, M sound, all rebindable under KEYS. On touch screens (`body.touch`): swipe anywhere to turn (keep sliding to turn again without lifting), tap the screen to dash, or use the d-pad with a DASH button either side of it under the screen (pad on the left and DASH on the right when the phone is sideways). How to play, with a picture of each character, sits beside the screen when there is room, otherwise behind the ? button. A test hook (`window.__fw`) exists only when `navigator.webdriver` is set. It has Spanish: its words are in `flickerwood/es.js` (lang.js), with a Language switch in How to play; the canvas words are chosen to need no accents (the 5×5 pixel font has none), and glade and critter names stay English. **The Wardrobe** (captains only for now, like the other games' hidden cosmetics): 28 looks for Glim in `flickerwood/wardrobe.js`, listed in `cosmetics.js` under `GAMES.flickerwood` (14 kits, 7 hats, 2 face pieces and 5 trails: sports kits, a tin firefly, pirates, suits and more, all seen from above). The page fetches `wardrobe.js` and `../cosmetics.js` only when `wardrobeOn()` is true (`FLICKERWOOD_PUBLIC`, the one line that opens it to everyone; a site captain through `captains.js`; or `?wardrobe=1` on localhost or in an automated browser), and then a hanger button appears in the top bar; for everyone else `WR` stays null and Glim is drawn exactly as before. Looks only: a look swaps `SP.glim` for pictures of the same 16 × 16 size (so the spare Glims on the score bar wear it too), no kit recolours the glowing yellow tail or the halo (what tells Glim from the critters), and trails are drawn under the critters and Glim, fade in 0.4 s and are never small yellow dots that could pass for pollen. Opening it pauses a game in progress. What is worn is saved in this browser as `flickerwood-look` (`{k, h, f, t}`, item numbers, 0 for none); nothing is sent anywhere. The words are in `es.js`. - `e63334287a3deaa3/lanternhold/`: Lanternhold (Back Room), a co-op tower defense game for 1 to 4 players (one file, three.js r128 with `../autores.js`, `../netsmooth.js` for teammates' pointers, Web Audio, Firebase Realtime Database rooms under `rooms/lh-`, same project and rules as Rumble Karts; invite links go through the home page as `#lh-`; no Quick match, rooms hold up to 4). The name, the Gloom, the towers, the maps, the art and the sounds are all our own. The Gloom walks a road across a floating island (a 20 × 12 grid of 2 m tiles, `GW`/`GH`/`T`) to the lantern; each one that gets there costs lives (`lv` in `EN`: 1, 2 for Shellbacks and Splitblobs, 15 for the boss). Towers go on grass tiles only (not road, scenery or the lantern). **Rules** are plain data and pure functions near the top of the script, the same in every browser, so a client can work out wave previews and enemy health without asking: `MAPS` (Meadow Bend, one long road; Twin Fords, two roads that meet; Whorl Garden, a spiral, whose flyers come from their own pink gate, `fly`, so they don't skip almost the whole map), `DIFFS` (Easy, Normal, Hard: health factor, lives 30/20/12, starting gold 720/620/540, bounty factor and seconds between waves), `EN` (Gloomling; Skitter, fast; Shellback, armour 7 taken off every hit, at least a quarter always goes through; Duskmoth, flies straight at the lantern; Splitblob, splits into three Bloblets; Mender, heals the Gloom near it 5% a second; Gloomwarden, the boss on every 10th wave, armoured, slow, and calls two Skitters every 5 s), `TW` (Bolt Spire, quick single shots, two at once at level 3; Thumper, lobbed blasts that hurt groups, ground only; Frost Bell, rings out to slow and chip everything near it, bosses half as much; Spark Coil, lightning that jumps between enemies; Sky Lance, flyers only, splash on nearby flyers; Sun Lens, a long beam that ignores armour), each with three levels (`lv`: range, damage, seconds between shots and the upgrade's cost) and a target mode (First, Last, Strong, Close). Selling gives back 70% of what went into the tower (`SELL`). `waveDef(w, map)` builds wave w from a seeded random pool (new kinds join at waves 2, 4, 5, 6 and 8, and the wave a kind first appears always has a group of it), `hpScale` makes them tougher each wave and faster still after wave 30. Survive 30 waves (`CAMPAIGN`) to win; then Keep going is endless mode. Gold: every kill's bounty and every wave's bonus (25 + 5 a wave) is split evenly between the players (`income`), each player spends their own share, and the team list has +50 to give gold to a teammate. Sending a wave before its countdown ends pays 2 gold per second left. Speed 1×, 2× or 3× (`sp`, anyone can change it). Only whoever built a tower can sell it (anyone can once they've left); anyone can upgrade or retarget it. `simStep(S, dt)` runs the game at a fixed 30 steps a second in solo, behind the menu (a demo game, `attract`) and on the online host; `act(S, uid, a)` applies one action (`b` build, `u` upgrade, `s` sell, `m` target mode, `w` send the wave, `f` speed, `g` give gold, `c` continue into endless) and returns '' or what went wrong. **Online:** each player writes only their own node `rooms/lh-/players/`: `n` name, `c` colour, `x`/`z` where their pointer is on the board (drawn on the others' screens as a ring and a name tag from a short history, NetSmooth), `h` (always 0), `ts` (server time), `j` (when they joined), and `ac`, their last 10 actions as JSON, each with a rising number `i` and the game number `g`. The host is whoever has the highest `he` with a published state, else whoever joined first (`Net.elect`); it runs the game, takes each player's new actions (`takeActs`, at most once each, by `i`, and only for the current game), and publishes the whole state as JSON in its own node's `rs` about 5 times a second (`encodeRS`: phase, wave, lives, gold per player, towers, enemies, Thumper shells in the air and the last shots, so clients can draw them). Clients rebuild the game from it (`decodeRS`, which checks every value) and move the Gloom on between snapshots from its speed, easing towards the host's numbers. If the host leaves, the next player picks up the last snapshot and carries on (`he` goes up by one), and a tab in the background keeps the host's game running once a second. The host picks the map and difficulty in the room's lobby and presses Start; anyone joining later gets a share of gold (the average, at most 250). Nodes are removed on leave and onDisconnect. **Saved in this browser** (localStorage, all `lanternhold:`): `name`, `color`, `map`, `diff`, `gfx` (Pretty, with shadows, or Fast; Fast is the default on touch screens), `sound`, `room` (the last room code) and `best::`, the best wave held. **stats.js:** `max('wave', waves held)` and `add('bosses', n)`; the Leaderboards show Most waves held and Gloomwardens beaten. **Touch:** shown only on touch screens (`body.touch`): tap a tower button, tap a tile to see the tower there, tap it again to build; drag to move the board, pinch to zoom. The camera fits the board into the space the HUD leaves (`fitCam`, `measureHud`), and on an upright phone the wave box becomes a row under the top bar and the dock gets compact. **Drawing:** the island, scenery and lantern are merged meshes with vertex colours; enemies, health bars, shots and rings are instanced meshes (their colour buffers are made at full size in `whiteColors`, because three r128's `setColorAt` sizes the buffer from the mesh's current count); particles are one Points draw. Automated browsers get a test hook, `window.__lh`. It has Spanish: its words, tower names and descriptions are in `lanternhold/es.js` (lang.js), with a Language switch on the menu and the pause screen; map names and the Gloom's names stay English, and nothing translated is sent to the room. **Wardrobe (hidden: captains only for now).** `LH_PUBLIC = false` and `wardOn()` (captains.js's `may(false, 'wardrobe', 'lh-wardrobe')`; `?wardrobe=1` for tests on localhost or in an automated browser) decide whether the menu shows a Wardrobe button under the colour swatches; for everyone else `lanternhold/wardrobe.js` is never fetched and the game is exactly as before, unless a teammate wears something, in which case it is fetched to draw them. It has 30 items in four slots, numbered as in `../cosmetics.js` (`lh-…`): 12 tower banners (a small flag on a pole at the back-left of every tower that player builds, seen by the whole team: sports pennants, a gear, a pirate flag with an eye-patched skull, a ship's wheel, pinstripes, a crown; baked into the tower's base mesh through `towerParts`' new `ban` argument, so a tower is still the same draw calls and its shape, owner band and level gems are untouched), 9 lanterns (the lantern's stand and cage on the captain's own screen only: `lanternGeo()` is the usual one, and `world.core.body`'s geometry is swapped; the flame, halo and light stay where they are and the same size), 5 flame colours (the flame's and halo's colour on the captain's own screen only; the point light is not recoloured, the low-lives flicker and the red flash are kept) and 4 build bursts (in place of the usual puff in `fxBuild` when that player builds or upgrades, seen by everyone, from the same particle pool). Saved in this browser as `lanternhold:wardrobe` (`'banner.lantern.flame.burst'`); online, a player's own node carries `cz: 'banner.burst'` (written with `Net.upd`) only while one of those is worn. Older pages ignore `cz`, `rs` and the actions are unchanged, and a page draws the usual look for numbers it doesn't know. The test hook `window.__lh` adds `WD` (with `wear(slot, n)`), `wardOn`, `wdLoad`, `wearOf`, `towerViews`, `towerMesh`, `wx`, `wz` and `world`. Its words and item names are in `lanternhold/es.js`. - `e63334287a3deaa3/windrow/`: Leaf Sweep (Back Room; first called Windrow, and the folder, the `WR` name in the code, the save key `windrow:v1`, `keybinds:windrow` and the stats name keep that), a calm single-player first-person game about clearing autumn leaves out of five walled gardens (three.js: the site's own r187 build, `/lib/three/r187/three.min.js` with its r128 layer, then `../autores.js`; no Firebase and no rooms, except `stats.js` for play time; no ads). The page is `index.html` (markup, styles, HUD and menus) plus five plain scripts in `js/`, loaded in this order: `world.js` (the areas, the collision grid and everything that stands still), `leaves.js` (the leaf simulation and its drawing), `audio.js` (every sound, made in code), `models.js` (gloves, sack, rake, blower, finder beams) and `game.js` (player, tools, money, HUD, menus, saving, the frame loop); `es.js` is its Spanish. Everything is drawn and textured in code; nothing is downloaded. **The start.** A new player stands on the doorstep of a garden house in the Front Yard (8 x 7 m of buried lawn with a stone path, one bin, low walls and a closed gate) with only their hands. It is a sixth area, `WR.AREAS[5]` (`WR.YARD`), added after the first five so the numbers in older saves keep their meaning; `WR.ORDER` is the order areas are listed in. Its leaves lie 1.5 times thicker (`dense`), and clearing it to 100% opens the gate to Gatehouse Court by itself, free. The screen shows a crosshair, the sack and the acorns, and one line of instruction at the bottom middle (`hintText` in `game.js`: hold to gather; sack full, empty it in the bin, with a bouncing marker over the bin; spend acorns in the shed; bought the rake; the gate is open), one at a time, each gone when done. Everything else appears when it first matters (`hudStatic`): percent cleared and the shed after the first sack is emptied, the tool bar with a second tool and only with tools owned, garden names, the Gardens tab and map, gate signs and the finder button once the court is open. The shed lists the sack, hands and rake at first and the rest as they become useful (`shedShows`). `state.seen` remembers which lines have been shown; a save that already has the court open skips them all. A short card at the start says what the game is and to pick up the leaves at your feet (`#intro`, gone after the first grab, and never shown with a notification). **Grabbing:** each click or tap picks up the leaves in a small circle where you look (`GRAB_R` in `game.js`: about 0.2 m across at first, so one to a few leaves; the circle is drawn over the leaves), at most one grab every 0.18 s. Bigger handfuls (the upgrade id `hands`, so older levels carry over) widens the circle in four steps; Steady hands (`hold`, offered once the rake is owned) keeps grabbing while the button is held. **Rake:** when bought it only pulls; Rake push (`rakePush`, 60) turns it round, and R or the Push/Pull button switches (`state.rakeMode`). Older saves keep what they had: a save with acorns earned before this change gets Steady hands, and one that owns the rake gets Rake push, so nobody loses holding to gather or pushing. A scripted player clicking 2.5 times a second empties its first sack in about 35 to 50 game-seconds, buys the rake (50) at about 2 to 3 minutes and clears the yard in 5 to 6.5 minutes; it clicks wastefully, so a careful person may be faster and a new one slower. **Captains** (`../captains.js`, `BackRoomCaptains.may(false, 'gardens')`, or `?gardens=1` on localhost or in an automated browser) find every gate open for that visit, so any garden can be tested at once; nothing is saved, no acorns or upgrades are given, and the gardens still count as locked in the save. **The garden** is flat, about 61 x 53 m, on one grid of 0.25 m cells (`WR.CELL`, 248 x 216; the plan in `world.js` is written at full size and every position is then multiplied by `WR.S` = 0.8, so the gardens are small and the leaves lie thick): `solid` blocks the player and the leaves, `gtype` is the surface (lawn, paving, decking, gravel: how far a leaf slides), `inlet` marks mulch-chute cells, `areaOf` says which garden a cell belongs to. The five big gardens are the first entries of `WR.AREAS` in `world.js` (Gatehouse Court, Orchard Walk, Lily Terrace, Glasshouse Row, Maze Lawn) with their gate cost, the garden that must be half cleared first, the bonus and the reward for finishing (sprint, kneel, higher jump, chutes that draw leaves in, a gold rake); bins, chutes, gates, trees, hedges and benches are lists just under it, and `WR.buildGrid` turns them into the grid, so moving a prop means editing its list only. Its last step, `seal()`, proves every leaf can be cleared: with all gates open it finds the cells a player can stand in, and any free cell with no standing spot within 2 m in a clear line (a slot behind a bench, say) is made solid, so neither leaves nor feet can get into it (5 cells with the present props; about 18 ms at load). **Leaves** are real objects, never removed by pointing: each has a place, a speed and a tumble, and leaves the garden only by being carried to a compost bin in the sack or by reaching a mulch chute. To stay cheap, resting leaves are asleep and cost nothing; each leaf sits in one grid cell (a linked list per cell), so a tool only visits the cells it reaches; and leaves do not collide one with another: a cell is a stack (each extra leaf rests 1.4 cm higher), a cell with 26 leaves turns sliding leaves away (40 for falling ones, about 56 cm) and a leaf near the top of a stack 5 taller than a neighbour slides off onto it. A leaf never moves more than 0.22 m in a step and its new place is rounded to what the arrays hold before the wall test, so nothing gets through or into a wall. That is what makes heaps against walls and rows in front of the rake. `Leaves.blow` is the blower (a cone; force falls with distance and with angle off the middle, 13 rays stop it at walls, leaves low in a heap are sheltered), `rake` carries the leaves under the head along with it, `scoop` sends the nearest leaves in a ring to the sack (they need a clear line from the player, except a garden's last 6 leaves, so none can be stranded behind a bench), `kick` is walking through them and `pull` the Draught grates reward. A leaf is two triangles: a flat card with one of four leaf shapes cut out of it (alpha test) by a 256 px atlas drawn in the page, tinted per leaf. They are drawn as instanced meshes, one per garden and leaf shape (20 draw calls); each mesh keeps its leaves in the order of the 4 m tile they started in and only the tiles where something moved are sent to the graphics card each frame. On top is one see-through 'litter' sheet whose opacity comes from a texture with one pixel per cell, so cleared ground looks clean about a second after its leaves go. **How many leaves** is the quality setting, in leaves per square metre of open ground (`WR.QUALITY`): Low 14 (27,600 leaves in the whole garden), Medium 24 (47,300), High 40 (78,800); Medium and High have a real shadow map from the low sun, drawn once (nothing that casts a shadow moves, except a gate opening), and Low has soft dark patches under the trees instead. Colours are written as screen colours and lit in linear light (`WR.lin`, sRGB output, ACES tone mapping), so any new colour or canvas texture must go through `WR.lin` or be marked sRGB. Phones start on Low, computers on Medium. Measured: with a fully upgraded blower sweeping through leaves the simulation costs 0.4 / 0.5 / 0.8 ms a step (1.4 / 3.0 / 2.8 ms at 4x CPU slowdown), with up to 2,800 leaves awake at once; looking across the first garden draws about 78k / 117k / 180k triangles in about 70 draw calls. Not measured: the cost of the cut-out leaves overlapping on a real phone's graphics chip (the test machines have none). `autores.js` lowers the resolution first; if frames stay slow for 8 s after that and the player never chose a setting, the game drops one leaf tier itself and says so. An area's leaves are worth the same in total at every tier (`units`; fewer leaves are each worth more), and the sack and the hands are measured in quality-free units too (an area's `leaves` number is its size in sack units; `Leaves.fill` is what one leaf takes), so progress and prices do not depend on the setting. Changing the setting scatters the leaves that are left again and keeps each garden's percent. **Looks and feedback.** `world.js` builds the house (door, lit windows, shutters, roof, chimney), trees with a crown of rounded masses shaded light above and dark below, walls with piers and caps, slatted benches, the fountain and a painted sky with cloud and a sun glow. `models.js` has rounded gloves on sleeves: open hands and the sack, a fist on the blower's handle, and two fists and forearms that follow the rake's handle in the garden itself. The blower shows wind streaks and lifts and tumbles leaves; landing from a jump throws leaves up and out, with a burst of loose leaves and a sound when it is a real heap; a rake stroke ends with a thump and a puff of crumbs; emptying the sack pours leaves into the bin; buying something pulses the HUD; 100% is a warm flash, falling leaves and a fanfare. **Tools and money.** Hands and sack, a rake (a stroke reaches out lifted, then drags back along the ground, so it pulls) and a blower (it pushes). Acorns come from leaves: at a bin when the sack is emptied (20% more for a full sack) or at once at a chute. `UP` in `game.js` is the shed (nine upgrades and their prices) and the arrays under it are what each level does; the models in `models.js` change with them. The leaf finder (F, or by itself when under 3% of a garden is left) lights the 8 nearest leaves of the garden you are standing in, and the journal map draws a dot for every leaf on the ground. **Saved data:** one localStorage key, `windrow:v1` (JSON): `acorns`, `earned`, `up` (upgrade levels), `unlocked` and `done` (per garden; six entries now, and a save with five is given the yard, open, as the sixth), `rewards`, `bagUnits` (what is in the sack, per garden) and `bagFill`, `gone` (share of each garden cleared), `tool`, `tut` (no longer used), `seen` (which instructions have been shown), `pos`, `secs`, `binFill`, `set` (look speed, volume, quality, flipped look, whether the player chose the quality), and `leaves` with `leafMul`: for each garden that has been touched, a base64 string of two 16-bit numbers a leaf (centimetres from the corner of the garden; 65535 = gone), about 250 KB at Medium and 420 KB at High once every garden has been disturbed; a leaf saved against a wall is stepped back out of it on loading. An untouched garden saves nothing and is scattered again from its seed. It saves 8 s after a change, on pause, and when the tab is hidden or closed. Keys are rebindable (`keybinds:windrow`); `autores.js` keeps its own scale. It is not in `account-nudge.js`'s KEYS, so it does not follow a Google account to another device, and it has no row in `leaderboard.js` or `miles.js`. **Touch:** `body.touch` is set on the first touch and shows `#touch` (left stick, Use, Jump, Run and Kneel once earned, a context button for bins and gates, and finder, journal and pause top right); the three tool slots at the bottom are tappable on any device. Portrait and landscape have their own positions in the style block; a drag on the view or on the Use button looks around. `WR.test` at the bottom of `game.js` is only for test scripts (start without a click, step the simulation, hold the tool, a simulation benchmark); nothing in the game calls it. -- `e63334287a3deaa3/ebbwork/`: Flood Crew (Back Room; first built as Ebbwork, and the folder, the `ebbwork:v1` save key and the names in the code keep that name), a single-player first-person flood-drainage game: each job is a flooded place, and you work out why it flooded and get it dry (three.js r187 from the site's own build with its r128 layer, then `../autores.js`; no Firebase, no rooms, no stats.js, no ads). It is our own design: the name, the six places, the tools, the prices and the text are ours. **Files:** `index.html` (the page and its styles), `game.js` (shaders, effects, controls, sound, HUD and menus), `models.js` (everything modelled: houses, fences, garden things, the van, drains, pipes, the things you put down, and the first-person hands and tools, all built from simple shapes and pictures drawn on a canvas, as `EWLook`), `core.js` (everything that is not drawing, with no DOM and no three.js in it, so `node` can load it: `require('./core.js')` gives `{EWSim, EW, EWMaps}`), `es.js` (its Spanish for `../lang.js`) and `preview.jpg`. **The water (`EWSim` in `core.js`, rewritten 26 Nov 2026 because the first version looked wrong: a checkerboard shimmer and a slow slosh):** the shallow-water equations on a grid of 0.5 m cells. Each cell has a ground height `g`, a barrier height `bar` laid on top and a depth `d` (kept in 64-bit numbers: with 32-bit ones a slow seep into a deep cell rounded away and volume drifted); each edge between two cells has a water speed (`u` across a cell's east edge, `v` across its south edge, m/s), so the water carries momentum: a current keeps going round a corner, piles up against a wall and swirls behind it. Every step (1/30 s, fixed): the speeds are carried along by the flow itself (semi-Lagrangian advection), speed up downhill on the water surface (`GRAV`), and are slowed by Manning friction (`mann`, 0.018), a drag on thin films (`film`) so a wet floor creeps rather than races, and a gentle linear drag (`drag`, 0.2 per second) so a pool settles instead of sloshing for minutes; then each edge carries speed × the depth on its upstream side (`fx`, `fy`), no cell may give more than it holds (flows out of a cell are scaled down together, and so are their speeds), and depths change by what flowed, so volume is conserved exactly: water only appears through `add()` and leaves through `take()`. Walls are `solid` cells. A 3 mm film (`FILM`) never flows, so floors keep real puddles in their dips. `push(x, z, vx, vz, r, f, dt)` shoves the water near a point along a velocity without adding or removing any (the player wading: a bow wave ahead and a wake behind). `vel(i, out)` gives a cell's current for drawing and for debris. Blocks of 8 × 8 cells sleep when nothing in or next to them is changing; an edge into a sleeping block carries nothing and wakes it (leaving that out loses water across the edge). One step with every block awake costs a few ms for the biggest job (68 × 48) on a desktop. `drag` and `film` were tuned so every job drains at least as fast as with the old water (node bot times, old to new: Marlow Row 152 to 157 s, Pell Street 182 to 181, Tanners Field 343 to 304, Fenny Underpass 246 to 255, Wharf Cellar 221 to 213, Mill Lane 411 to 346); raising them makes the long jobs drag on. **A job site (`EW.World`):** built from a map's `build(b)` with metres as the unit (x east, z south): `ground`, `shape` and `noise` set heights; `surf` sets the surface type and whether it can be dug; `wall` makes solid blocks (its `kind` is only for drawing); `drain` (a `rate` in m³/s and a `cap`: how much debris blocks it fully), `sinkArea` (water there leaves the map: a ditch or storm channel), `river` (cells held at a level: a stream that both feeds and takes water), `leak` (fed by a `valve` id, or `wrench: true` for a dripping joint), `valve`, `socket`, `litter`, `flood`, `spot` (a note the player gets when they walk near, kept in the journal), `sign`, `station` (the depot's board, bench and van) and `noJob` (cells that don't count). `step(dt)` runs leaks, the river, pumps, drains, sinks, the water and the debris, in that order. Debris floats in more than 5 cm of water, drifts with the current and towards a running drain, strands when the water drops, and blocks a drain by lying within 0.85 m of it (`clog`): a drain's rate is `rate × World.DRAINX × (0.03 + 0.97 × clear^1.25)`, and it takes that from its own cell and, when that runs short, from the cells within about a metre (`catchment`), so a cleared drain visibly pulls the level down. `World.DRAINX` (2.5) and `World.PUMPX` (2, on `pumpRate`) were added on 26 Nov 2026 when the owner found draining too slow; node bot times after that change: Marlow Row 72 s, Pell Street 109, Tanners Field 215, Fenny Underpass 153, Wharf Cellar 173, Mill Lane 310. Debris that has just been raked lies in a sodden heap for 45 seconds (`heavy`) before it can float off again, so a cleared drain stays clear long enough for the level to fall away from the heap. The job is done (`isDone`) when the water left in the job's cells is at most 3% of the most there has been (`World.DONE`) and nothing is still coming in; a skin of water under 8 mm (`World.SKIN`) is wet ground, not flood, and is not counted, which is what stops a job ending in minutes of waiting for a thin sheet to creep away. **Tools (each one a function on the world, so a test can call it):** `rake` (push or pull debris), `scoop` and `pour` (the 30-litre bucket), `squeegee` (moves water under 7 cm one cell along), `dig` and `pile` (soft ground only, down to `DIGMAX` 0.9 m (raised from 0.64 in Nov 2026 so a cut through Tanners Field's bank goes lower than a one-dig trench in the field); one stroke takes the cell down 0.24 m and pulls its four neighbours down with it, so a trench is a few strokes and is wide enough to run; piling uses the spoil you dug), `placeBarrier` (three cells in a row, four directions, `BARH` 0.36 m; refused on drains, ditches and the river), `placePump` / `setHose` / `placeGen` (a pump runs when it is on, has a socket or a live generator within cable reach and has a hose end; water it takes goes to the hose end's cell, so emptying into the same pool does nothing, and it only leaves the map if the hose end is on a sink or the river; a generator standing in more than 14 cm of water stops), `takeDebris` (the sack: removes debris for good), `setValve` and `fixLeak`. **The jobs (`EWMaps`, in order; a job opens when the one before has a star):** Marlow Row (a back yard: a drain buried in leaves and a split pipe whose copper supply pipe, drawn along the house wall with `pipe`, leads round the corner to its tap; a dripping joint on that pipe for the wrench, a second smaller drain by the side path, and a hollow in the lawn with a lip round it (in `ground`) that keeps a puddle only the bucket can empty; a new player starts here, standing in it: the yard starts shin to knee deep, half a metre at the drain, so that it plainly is a flood and the before and after are obvious; see **The start** below), Pell Street (three hidden drains, a dripping joint, a paving dip that keeps a puddle), Tanners Field (allotments in a hollow with no drain: a trench through the bank to the ditch, marked out by two lines of orange survey pegs with string (`deco` kind `pegs`); the hollow falls towards that line; the ditch slopes south along the hedge and only its far end (`sinkArea`) takes water away, so water can be seen running into it and along it, and the ditch is `noJob`; a choked culvert, drawn with a concrete pipe through the bank (`drain` option `pipe`), that sits too high to finish the job), Fenny Underpass (a dead sump: pump from a wall socket with the hose over the crest to the storm channel, and a water main valve at the far end), Wharf Cellar (the river seeps in through a doorway: sandbags, then pump up the steps; it is dark, so `sky: 'cellar'` gives a head torch) and Mill Lane (a stream through its bank, a culvert under a raft of debris, a walled garden that needs the pump and the generator, a hollow to trench). `EWMaps.depot` is the depot: not a job, a yard with the job board, the gear bench and the van, and a puddle. **The start (rebuilt 26 Nov 2026 after the owner found the first version confusing, and given more to do the same day after they found it too basic):** Play puts a new player straight into Marlow Row holding the rake and nothing else. `GUIDES.yard` gives one short line at a time at the bottom of the screen and each goes when it has been done: move, find the drain, rake it, follow the pipe to the tap and shut it, tighten the dripping joint (the wrench joins the bar, key 2), rake the second drain, empty the lawn puddle with the bucket (it joins the bar, key 3), keep the drains clear until it is dry. A step's `give` adds its tool to the bar. `GUIDES.field` does the same for Tanners Field (shut the standpipe, follow the pegs, dig through the bank, carry the trench back one dig deep, keep it running). A guide runs until that job has a star, and a job cannot finish while its guide is still running (the last step is always "until it is dry"). What a new player has not met yet is not on screen: `firstJob()` hides the scan and journal buttons, the other tools and the job's notes; the depot appears only after that job, with just the job board working (taking a job from it sets off at once); the gear bench appears after the second job (`shopOpen()`), and the van and its loadout only once the player owns more tools than it holds (`vanNeeded()`). The HUD in a job is a crosshair, one water bar, the tool, and one line of words (`#say`, which carries the instruction or else the latest message); there is no clock or coin count in a job. Each map has `pay`, `par` (the target time in seconds) and `needs` (what the job board suggests bringing, shown only after the player has been there once, so the first visit is for finding out). Stars: one for finishing, a second inside 1.6 × `par`, a third inside `par` with 1.5% or less left; pay is `pay × (0.6 + 0.2 × stars)`, halved when the job has been done before. **Gear** (`GEAR` in the page): tools with `slot: 1` take one of the van's five places (seven with Van racking); the rest are upgrades (more sandbags, long hose, cable reel, second pump, waders, racking). Prices are set so that one-star pay alone affords each next job's tool. **Captains** (`BackRoomCaptains.may` from `../captains.js`, loaded in the page's ``; on localhost and in test browsers `?floodcap=1` stands in): Play goes straight to the depot, every job on the board is open, and in a job the bar holds every tool that job's `needs` lists as well as their own (with the usual sandbags, pump and generator). Nothing of it is saved: their save keeps only the stars and pay they earn. Ordinary players are unchanged. **Storage:** localStorage `ebbwork:v1` only: `{v, coins, gear, load, jobs: {: {stars, best, n, seen}}, set: {sens, vol, q, inv}, tut}`; keep `v: 1` and these names working if you change it. Nothing is sent anywhere. **Drawing:** the ground and the water are each one mesh with a vertex at every cell centre. The ground (`terrainMat`) is three's own lit material with our patterns added in `onBeforeCompile` (grain, paving joints, and wet ground that is darker and shiny until it dries over about half a minute, so the band the water has just left is plain to see), which lets it take the sun's shadows and the cellar torch. The water (`waterMat`) is our own shader: its vertices carry depth and speed, a dry cell beside water takes its neighbours' surface height with a negative depth, and the shader throws away everything shallower than 3 mm, so the shoreline is a smooth line where the surface meets the ground and no squares show; it is brown where deep and clear where thin, with a pale lapping line a few centimetres wide at the edge (measured with screen-space derivatives of the depth, so it stays thin on a gentle slope and only shows where the water is under about 9 cm). Between two water steps the vertices are blended from the last step to this one (`aPrev`, `uLerp`), so the surface moves at the screen's frame rate, not 30 times a second. The surface slope of the simulation (`aSlope`) tilts the lighting, so a wake or a bow wave shows as a darker or brighter band. Up to four running drains (`uDr`) each get a whirlpool: a dip in the surface, the pattern twisted round the drain, a dark eye and thin spiral streaks. The ground under shallow water is tinted and gets moving caustics (High only). **Ripples** are a separate wave-equation height field on the graphics card (`RIP`: two half-float pictures swapped each step, 0.07 m texels on High at 60 steps a second, 0.12 m at 30 on Low, damped, and faded out where the flood is under about 2 cm, from a small picture of the depths, `tSim`, updated each water step). `rip(x, z, r, a)` drops a ring-shaped bump in (up to 16 a frame): the legs when wading, and everything that calls `ring()` (splashes and the like), which uses it in place of flat ring sprites. The water shader reads the ripple slope to bend the reflection and the light, with pale crests where it is steep. Without WebGL2 and half-float render targets ripples are off (`RIP.ok`) and `ring()` falls back to sprites. `__ew.U.uRipDbg.value = 1` shows the ripple heights in false colour, for tuning. The light is a low warm sun with a cool sky fill; shadows come from one shadow map that is drawn once per site and again only when something is put down (`shadowMap.autoUpdate` is off), 2048 on High and 1024 on Low. Splashes, rings, drops and the pale flecks that ride the current are small pools in `fx` (`ring`, `splash`, `drop`, `fleckSpawn`). The scene is drawn once more upside down into a picture (`renderReflection`) so the water mirrors the buildings and sky: half the screen's resolution every frame on High, a third of it (at least 256 × 160) every other frame on Low; the sun's disc is left out of that pass (`uNoSun`) because a mirrored sun clipped to white blotches, and the water adds its own sharp sun glint instead. On Low the water also skips its two finest pattern layers, the silt layer and two of the four ripple reads (`uHi`). Low gets it too because without it the water did not read as water on a phone. The walls' materials carry one clipping plane all the time (it only bites during the mirror pass), because switching the renderer's planes on and off each frame made three re-check every material. Graphics: Phones ask for a pixel ratio of up to 2 on any setting, so that `../autores.js`, which can halve it, never takes them under 1. Auto starts High on computers and Low on touch screens and Chromebooks, and steps down to Low for the rest of the visit if frames stay under about 34 a second for nine seconds, after `../autores.js` has had its chance to lower the resolution (`quality`, `autoLow`); it never steps back up by itself. On Low there is one more step for slow phones: if frames stay under about 27 a second for nine seconds, the mirror pass is switched off for the visit (`mirrorOff`) and the water shows the sky only. Walls and props are merged into five meshes by surface (`Batch` in `models.js`: brick, wood, roof, plain and glass), each kind of block a map declares being drawn by `thing()`; debris is three instanced meshes; the first-person hands and tools are each baked into one mesh (`bake`); and things the player puts down are rebuilt together when they change (`EWLook.dyn`). **Sound** is all made in the page with the Web Audio API (`sfx`, `audioTick`): steps and wading, splashes, raking, digging, a gulp when a drain runs shallow, the pump's hum, and a lapping that fades as the place dries. **Touch:** a walk stick on the left (push it right out to run), drag anywhere else to look, and Use and Jump buttons in `#touch`, with Alt (only for tools that have a second use), Do (when you face something to work) and Turn (sandbags) appearing when they apply, all shown only on touch screens; the tool bar moves to the top there. A slow frame is caught up rather than played in slow motion: up to a quarter of a second, as up to eight water steps and the walking split into 40 ms pieces. **Tests:** `window.__ew` (the world, the player, `start(id)`, `ff(seconds)` to run the water ahead, `use()`, `select()`) is for tests and tuning from the console. To check a changed map can still be finished, load `core.js` in node, build `new EW.World(map)` and call the tool functions and `step(1/30)` until `isDone()`; every job was checked that way when it was made. **To add a job:** push a map onto `MAPS` in `core.js` after the last one (ids are saved, so never rename or reorder them), give it `needs`, `pay` and `par`, put its Spanish in `es.js`, and finish it with a node script before trying it by hand. +- `e63334287a3deaa3/ebbwork/`: Flood Crew (Back Room; first built as Ebbwork, and the folder, the `ebbwork:v1` save key and the names in the code keep that name), a single-player first-person flood-drainage game: each job is a flooded place, and you work out why it flooded and get it dry (three.js r187 from the site's own build with its r128 layer, then `../autores.js`; no Firebase, no rooms, no stats.js, no ads). It is our own design: the name, the six places, the tools, the prices and the text are ours. **Files:** `index.html` (the page and its styles), `game.js` (shaders, effects, controls, sound, HUD and menus), `models.js` (everything modelled: houses, fences, garden things, the van, drains, pipes, the things you put down, and the first-person hands and tools, all built from simple shapes and pictures drawn on a canvas, as `EWLook`), `core.js` (everything that is not drawing, with no DOM and no three.js in it, so `node` can load it: `require('./core.js')` gives `{EWSim, EW, EWMaps}`), `es.js` (its Spanish for `../lang.js`) and `preview.jpg`. **The water (`EWSim` in `core.js`, rewritten 26 Nov 2026 because the first version looked wrong: a checkerboard shimmer and a slow slosh):** the shallow-water equations on a grid of 0.5 m cells. Each cell has a ground height `g`, a barrier height `bar` laid on top and a depth `d` (kept in 64-bit numbers: with 32-bit ones a slow seep into a deep cell rounded away and volume drifted); each edge between two cells has a water speed (`u` across a cell's east edge, `v` across its south edge, m/s), so the water carries momentum: a current keeps going round a corner, piles up against a wall and swirls behind it. Every step (1/30 s, fixed): the speeds are carried along by the flow itself (semi-Lagrangian advection), speed up downhill on the water surface (`GRAV`), and are slowed by Manning friction (`mann`, 0.018), a drag on thin films (`film`) so a wet floor creeps rather than races, and a gentle linear drag (`drag`, 0.2 per second) so a pool settles instead of sloshing for minutes; then each edge carries speed × the depth on its upstream side (`fx`, `fy`), no cell may give more than it holds (flows out of a cell are scaled down together, and so are their speeds), and depths change by what flowed, so volume is conserved exactly: water only appears through `add()` and leaves through `take()`. Walls are `solid` cells. A 3 mm film (`FILM`) never flows, so floors keep real puddles in their dips. `push(x, z, vx, vz, r, f, dt)` shoves the water near a point along a velocity without adding or removing any (the player wading: a bow wave ahead and a wake behind). `vel(i, out)` gives a cell's current for drawing and for debris. Blocks of 8 × 8 cells sleep when nothing in or next to them is changing; an edge into a sleeping block carries nothing and wakes it (leaving that out loses water across the edge). One step with every block awake costs a few ms for the biggest job (68 × 48) on a desktop. `drag` and `film` were tuned so every job drains at least as fast as with the old water (node bot times, old to new: Marlow Row 152 to 157 s, Pell Street 182 to 181, Tanners Field 343 to 304, Fenny Underpass 246 to 255, Wharf Cellar 221 to 213, Mill Lane 411 to 346); raising them makes the long jobs drag on. **A job site (`EW.World`):** built from a map's `build(b)` with metres as the unit (x east, z south): `ground`, `shape` and `noise` set heights; `surf` sets the surface type and whether it can be dug; `wall` makes solid blocks (its `kind` is only for drawing); `drain` (a `rate` in m³/s and a `cap`: how much debris blocks it fully), `sinkArea` (water there leaves the map: a ditch or storm channel), `river` (cells held at a level: a stream that both feeds and takes water), `leak` (fed by a `valve` id, or `wrench: true` for a dripping joint), `valve`, `socket`, `litter`, `flood`, `spot` (a note the player gets when they walk near, kept in the journal), `sign`, `station` (the depot's board, bench and van) and `noJob` (cells that don't count). `step(dt)` runs leaks, the river, pumps, drains, sinks, the water and the debris, in that order. Debris floats in more than 5 cm of water, drifts with the current and towards a running drain, strands when the water drops, and blocks a drain by lying within 0.85 m of it (`clog`): a drain's rate is `rate × World.DRAINX × (0.03 + 0.97 × clear^1.25)`, and it takes that from its own cell and, when that runs short, from the cells within about a metre (`catchment`), so a cleared drain visibly pulls the level down. `World.DRAINX` and `World.PUMPX` (on `pumpRate`) were added on 26 Nov 2026 when the owner found draining too slow (2.5 and 2), then eased to 2.1 and 1.8 on 27 Nov when it felt a bit too quick; node bot times since: Marlow Row 80 s, Pell Street 151, Tanners Field 250, Fenny Underpass 165, Wharf Cellar 175, Mill Lane 311. The `par` times were tightened at the same time (150, 240, 380, 290, 310, 480 s), because the jobs had got much quicker than when they were set. Debris that has just been raked lies in a sodden heap for 45 seconds (`heavy`) before it can float off again, so a cleared drain stays clear long enough for the level to fall away from the heap. The job is done (`isDone`) when the water left in the job's cells is at most 3% of the most there has been (`World.DONE`) and nothing is still coming in; a skin of water under 8 mm (`World.SKIN`) is wet ground, not flood, and is not counted, which is what stops a job ending in minutes of waiting for a thin sheet to creep away. **Tools (each one a function on the world, so a test can call it):** `rake` (push or pull debris), `scoop` and `pour` (the 30-litre bucket), `squeegee` (moves water under 7 cm one cell along), `dig` and `pile` (soft ground only, down to `DIGMAX` 0.64 m below where the cell started, or to the map's `digFloor` level if that is lower (`digLow`): Tanners Field has `digFloor: -0.5`, so its bank can be cut as deep as the field beside it and a trench through it never has to stay a pond; one stroke takes the cell down 0.24 m and pulls its four neighbours down with it, so a trench is a few strokes and is wide enough to run; piling uses the spoil you dug), `placeBarrier` (three cells in a row, four directions, `BARH` 0.36 m; refused on drains, ditches and the river), `placePump` / `setHose` / `placeGen` (a pump runs when it is on, has a socket or a live generator within cable reach and has a hose end; water it takes goes to the hose end's cell, so emptying into the same pool does nothing, and it only leaves the map if the hose end is on a sink or the river; a generator standing in more than 14 cm of water stops), `takeDebris` (the sack: removes debris for good), `setValve` and `fixLeak`. **The jobs (`EWMaps`, in order; a job opens when the one before has a star):** Marlow Row (a back yard: a drain buried in leaves and a split pipe whose copper supply pipe, drawn along the house wall with `pipe`, leads round the corner to its tap; a dripping joint on that pipe for the wrench, a second smaller drain by the side path, and a hollow in the lawn with a lip round it (in `ground`) that keeps a puddle only the bucket can empty; a new player starts here, standing in it: the yard starts shin to knee deep, half a metre at the drain, so that it plainly is a flood and the before and after are obvious; see **The start** below), Pell Street (three hidden drains, a dripping joint, a paving dip that keeps a puddle; made harder on 27 Nov 2026: about 31 cm of water, a slower loading-bay drain, and plenty of extra rubbish afloat that washes back onto the gullies), Tanners Field (allotments in a hollow with no drain: a trench through the bank to the ditch, the ditch slopes south along the hedge and only its far end (`sinkArea`) takes water away, so water can be seen running into it and along it, and the ditch is `noJob`; a choked culvert, drawn with a concrete pipe through the bank (`drain` option `pipe`), that sits too high to finish the job), Fenny Underpass (a dead sump: pump from a wall socket with the hose over the crest to the storm channel, and a water main valve at the far end), Wharf Cellar (the river seeps in through a doorway: sandbags, then pump up the steps; it is dark, so `sky: 'cellar'` gives a head torch) and Mill Lane (a stream through its bank, a culvert under a raft of debris, a walled garden that needs the pump and the generator, a hollow to trench). `EWMaps.depot` is the depot: not a job, a yard with the job board, the gear bench and the van, and a puddle. **The start (rebuilt 26 Nov 2026 after the owner found the first version confusing, and given more to do the same day after they found it too basic):** Play puts a new player straight into Marlow Row holding the rake and nothing else. `GUIDES.yard` gives one short line at a time at the bottom of the screen and each goes when it has been done: move, rake the drain, shut the tap, the dripping joint (the wrench joins the bar, key 2), the lawn puddle (the bucket joins the bar, key 3). The second drain by the side path gets no line: it is there to be noticed. A step's `give` adds its tool to the bar, the guide runs until the yard has a star, and the job cannot finish while it is running. Later jobs have no guide (the owner found the step-by-step lines on Tanners Field too easy): only the brief, the notes (`spot`) and one hint, said once, when the player has dug, nothing is coming in and the level has not dropped by 1% in 40 seconds of water time (`stuck`): look for where water stands in the trench and dig the high part deeper. What a new player has not met yet is not on screen: `firstJob()` hides the scan and journal buttons, the other tools and the job's notes; the depot appears only after that job, with just the job board working (taking a job from it sets off at once); the gear bench appears after the second job (`shopOpen()`), and the van and its loadout only once the player owns more tools than it holds (`vanNeeded()`). The HUD in a job is a crosshair, one water bar, the tool, and one line of words (`#say`, which carries the instruction or else the latest message); there is no clock or coin count in a job. Each map has `pay`, `par` (the target time in seconds) and `needs` (what the job board suggests bringing, shown only after the player has been there once, so the first visit is for finding out). Stars: one for finishing, a second inside 1.6 × `par`, a third inside `par` with 1.5% or less left; pay is `pay × (0.6 + 0.2 × stars)`, halved when the job has been done before. **Gear** (`GEAR` in the page): tools with `slot: 1` take one of the van's five places (seven with Van racking); the rest are upgrades (more sandbags, long hose, cable reel, second pump, waders, racking). Prices are set so that one-star pay alone affords each next job's tool. **Captains** (`BackRoomCaptains.may` from `../captains.js`, loaded in the page's ``; on localhost and in test browsers `?floodcap=1` stands in): Play goes straight to the depot, every job on the board is open, and in a job the bar holds every tool that job's `needs` lists as well as their own (with the usual sandbags, pump and generator). Nothing of it is saved: their save keeps only the stars and pay they earn. Ordinary players are unchanged. **Storage:** localStorage `ebbwork:v1` only: `{v, coins, gear, load, jobs: {: {stars, best, n, seen}}, set: {sens, vol, q, inv}, tut}`; keep `v: 1` and these names working if you change it. Nothing is sent anywhere. **Drawing:** the ground and the water are each one mesh with a vertex at every cell centre. The ground (`terrainMat`) is three's own lit material with our patterns added in `onBeforeCompile` (grain, paving joints, and wet ground that is darker and shiny until it dries over about half a minute, so the band the water has just left is plain to see), which lets it take the sun's shadows and the cellar torch. The water (`waterMat`) is our own shader: its vertices carry depth and speed, a dry cell beside water takes its neighbours' surface height with a negative depth, and the shader throws away everything shallower than 3 mm, so the shoreline is a smooth line where the surface meets the ground and no squares show; it is brown where deep and clear where thin, with a pale lapping line a few centimetres wide at the edge (measured with screen-space derivatives of the depth, so it stays thin on a gentle slope and only shows where the water is under about 9 cm). Between two water steps the vertices are blended from the last step to this one (`aPrev`, `uLerp`), so the surface moves at the screen's frame rate, not 30 times a second. The surface slope of the simulation (`aSlope`) tilts the lighting, so a wake or a bow wave shows as a darker or brighter band. Up to four running drains (`uDr`) each get a whirlpool: a dip in the surface, the pattern twisted round the drain, a dark eye and thin spiral streaks. The ground under shallow water is tinted and gets moving caustics (High only). **Ripples** are a separate wave-equation height field on the graphics card (`RIP`: two half-float pictures swapped each step, 0.07 m texels on High at 60 steps a second, 0.12 m at 30 on Low, damped, and faded out where the flood is under about 2 cm, from a small picture of the depths, `tSim`, updated each water step). `rip(x, z, r, a)` drops a ring-shaped bump in (up to 16 a frame): the legs when wading, and everything that calls `ring()` (splashes and the like), which uses it in place of flat ring sprites. The water shader reads the ripple slope to bend the reflection and the light, with pale crests where it is steep. Without WebGL2 and half-float render targets ripples are off (`RIP.ok`) and `ring()` falls back to sprites. `__ew.U.uRipDbg.value = 1` shows the ripple heights in false colour, for tuning. The light is a low warm sun with a cool sky fill; shadows come from one shadow map that is drawn once per site and again only when something is put down (`shadowMap.autoUpdate` is off), 2048 on High and 1024 on Low. Splashes, rings, drops and the pale flecks that ride the current are small pools in `fx` (`ring`, `splash`, `drop`, `fleckSpawn`). The scene is drawn once more upside down into a picture (`renderReflection`) so the water mirrors the buildings and sky: half the screen's resolution every frame on High, a third of it (at least 256 × 160) every other frame on Low; the sun's disc is left out of that pass (`uNoSun`) because a mirrored sun clipped to white blotches, and the water adds its own sharp sun glint instead. On Low the water also skips its two finest pattern layers, the silt layer and two of the four ripple reads (`uHi`). Low gets it too because without it the water did not read as water on a phone. The walls' materials carry one clipping plane all the time (it only bites during the mirror pass), because switching the renderer's planes on and off each frame made three re-check every material. Graphics: Phones ask for a pixel ratio of up to 2 on any setting, so that `../autores.js`, which can halve it, never takes them under 1. Auto starts High on computers and Low on touch screens and Chromebooks, and steps down to Low for the rest of the visit if frames stay under about 34 a second for nine seconds, after `../autores.js` has had its chance to lower the resolution (`quality`, `autoLow`); it never steps back up by itself. On Low there is one more step for slow phones: if frames stay under about 27 a second for nine seconds, the mirror pass is switched off for the visit (`mirrorOff`) and the water shows the sky only. Walls and props are merged into five meshes by surface (`Batch` in `models.js`: brick, wood, roof, plain and glass), each kind of block a map declares being drawn by `thing()`; debris is three instanced meshes; the first-person hands and tools are each baked into one mesh (`bake`); and things the player puts down are rebuilt together when they change (`EWLook.dyn`). **Sound** is all made in the page with the Web Audio API (`sfx`, `audioTick`): steps and wading, splashes, raking, digging, a gulp when a drain runs shallow, the pump's hum, and a lapping that fades as the place dries. **Touch:** a walk stick on the left (push it right out to run), drag anywhere else to look, and Use and Jump buttons in `#touch`, with Alt (only for tools that have a second use), Do (when you face something to work) and Turn (sandbags) appearing when they apply, all shown only on touch screens; the tool bar moves to the top there. A slow frame is caught up rather than played in slow motion: up to a quarter of a second, as up to eight water steps and the walking split into 40 ms pieces. **Tests:** `window.__ew` (the world, the player, `start(id)`, `ff(seconds)` to run the water ahead, `use()`, `select()`) is for tests and tuning from the console. To check a changed map can still be finished, load `core.js` in node, build `new EW.World(map)` and call the tool functions and `step(1/30)` until `isDone()`; every job was checked that way when it was made. **To add a job:** push a map onto `MAPS` in `core.js` after the last one (ids are saved, so never rename or reorder them), give it `needs`, `pay` and `par`, put its Spanish in `es.js`, and finish it with a node script before trying it by hand. - `e63334287a3deaa3/daily/`: Daily Puzzles (Back Room), the dashboard for every daily puzzle. No libraries, no network except stats.js. `DAILY_GAMES` at the top of the script lists every daily game (`slug` = folder = storage key `daily:`, name, icon, `cat`: word, geo, logic, est (Estimation) or soccer, a one-line blurb, `ready`), plus `EXTRA` link cards under Play together (Puffer Party, `chip` in place of a daily status). Tiles only show for `ready:true` games, and "Coming soon" ones are listed under each category; flip `ready` when a game's folder lands. For each game it reads the shared record `daily:` (written by the game when a daily ends: `{ v:1, days:{YYYYMMDD:{done,win,score,tries,time}}, played, wins, streak, maxStreak, last, dist }`) and shows today's status (Not played, Solved in N / in m:ss, Done, or Missed) and the game's 🔥 streak (only while its last win was today or yesterday). Deepword is read from its own `deepword:` keys. The summary counts today's finished puzzles, the overall streak (days in a row, ending today or yesterday, with at least one daily done, worked out from every game's `days`), and counts down to local midnight; when every ready game is done it shows an "All done today" banner. stats.js (`data-game="daily"`): `max('streak', overall)` and `add('done', 1)` once per game per day (remembered in `daily-hub:counted`). It re-reads storage when the tab comes back into view or another tab writes, so finishing a puzzle in another tab updates it. Test hook: `window.__dh` under webdriver (`setToday`, `render`, `streakOverall`). A game whose win shouldn't read "Solved in " gives a `show` template (`{tries}`, `{score}`, `{time}`; `{score|hint}` adds the word, plural unless the number is 1, and `zero` is the text used when the number is 0): Crosslet shows its time, Ninefold puzzles solved of 3, Crossbar squares, Stat Duel calls right, Top Bins entries found, Quartets mistakes (Perfect for none), Sleight hints, Poopdle moves, Mainstream its points, Yardstick its total out of 500 and Thereabouts its average miss (`{score|x100}`: a score saved as a hundred times a decimal, so 137 reads "1.37×"). A missed puzzle's tile has the finished look but no ✓. Poopdle and Thereabouts are under Logic. `RETIRED`, under `DAILY_GAMES`, holds the daily puzzles taken off the list on 18 Nov 2026 (the least played; see the Back Room page above): they have no tile and aren't in today's total, but their records still count toward the overall streak, so taking a puzzle off never shortens anyone's streak, and a category with nothing listed (Soccer, for now) isn't shown. To bring one back, move its line back into `DAILY_GAMES`. The daily games don't have Back Room or phone-page cards of their own: the Daily Puzzles card and tile are the way in (the phone thumbnails in `m/thumbs/` are kept for if they ever do). - `e63334287a3deaa3/hunch/`: Hunch (Back Room, a daily puzzle on the Daily Puzzles page), a five-letter word guess in six tries, like Wordle. No libraries, no network: `words.js` holds `window.WORDS5 = { ANSWERS, GUESSES }` as space-separated strings, 2,019 answers (common, school-safe, no plurals) and 6,334 more allowed guesses (8,353 in all), written for the site and checked by a script (five letters a–z, no repeats, every answer also a guess, a blocklist for rude words). `ANSWERS` is already in daily order (a fixed seeded shuffle): day n after 1 November 2026 (puzzle #n+1, from the player's local date) uses `ANSWERS[n % length]`, so new answers must be **appended** to keep past days unchanged. Scoring marks greens first, then yellows only for as many copies as the answer has left. Hard mode (Settings, only before a game's first guess) makes every green stay put and every found letter be reused; High contrast swaps green/yellow for orange/blue. Unlimited mode picks random answers and never touches daily stats. Storage: the shared daily record `daily:hunch` (`{ v:1, days:{YYYYMMDD:{done,win,score,tries,time,hard?}}, played, wins, streak, maxStreak, last, dist }`, 60 days kept; the Daily Puzzles page reads it), the day in progress `hunch:day` (`{ d, g:[guesses], hard, t0 }`), Unlimited `hunch:free`, settings `hunch:settings`, `hunch:seen` (how-to shown) and `hunch:mode`. stats.js (`data-game="hunch"`): `add('wins')`, `max('streak')`, `min('fewest')`. The page is generated from the same engine as Fourcast (`CFG` at the top of the script: boards, rows, offset); keep the two in step when fixing the engine. Tile size is worked out in `fit()` (bigger of the layouts that fit); on a sideways phone the keyboard sits right of the board. Test hooks: `window.__wg` under webdriver (`setToday('YYYYMMDD')`, `type(word)`, `score`, …). Thanksgiving Day 2026 (`TG_DAY`) has its own answer, FEAST, set in `answersFor` for Hunch only; every other day and Fourcast are unchanged. **Spanish:** `es.js` has its words (lang.js), with a language switch in Settings; the words are English by design and tagged "En inglés". - `e63334287a3deaa3/fourcast/`: Fourcast (Back Room, a daily puzzle), four five-letter words at once in nine guesses, like Quordle. The same engine as Hunch with `boards: 4, rows: 9, offset: 777`, and the same word lists (it loads `/e63334287a3deaa3/hunch/words.js`, so don't move that file). Each guess goes on every unsolved board; a solved board stops. Day n uses `ANSWERS[(777 + 4n + k) % length]` for boards k = 0–3, so appending answers keeps past days. Each keyboard key shows four corner colours, one per board in reading order (top left = board 1). Tiles may be up to 1.45× wider than tall, and `fit()` picks a 1 × 4 or 2 × 2 layout, whichever gives bigger tiles; on a sideways phone the keyboard stays underneath in short rows. Win = all four within nine; the share card shows the guess each board fell on (🟥 for missed). Storage: `daily:fourcast` (same contract; each day also has `boards`, how many were solved), `fourcast:day`, `fourcast:free`, `fourcast:settings`, `fourcast:seen`, `fourcast:mode`. stats.js: `add('wins')`, `max('streak')`, `min('fewest')`. **Spanish:** `es.js` has its words (lang.js), with a language switch in Settings; the words are English by design and tagged "En inglés". diff --git a/e63334287a3deaa3/ebbwork/core.js b/e63334287a3deaa3/ebbwork/core.js index d30a62b5..26cf59af 100644 --- a/e63334287a3deaa3/ebbwork/core.js +++ b/e63334287a3deaa3/ebbwork/core.js @@ -296,10 +296,13 @@ var EW=(function(){ P.scoop=function(x,z,cap){var w=this,S=w.S,cells=[],tot=0;w.each(x-0.75,z-0.75,x+0.75,z+0.75,function(i){if(!S.solid[i]&&S.d[i]>0.001){cells.push(i);tot+=S.d[i]*AREA}}); if(tot<=0)return 0;var take=Math.min(cap,tot*0.95),got=0;for(var k=0;k-1e8){this.removed+=vol;return vol}return this.S.add(i,vol)}; - P.canDig=function(x,z){var i=this.cell(x,z);return i>=0&&this.soft[i]&&!this.S.solid[i]&&!this.S.bar[i]&&this.S.g[i]>this.g0[i]-World.DIGMAX+0.01}; + // how low a cell can be dug: DIGMAX below where it started, or a map's `digFloor` (a level in metres) if that is lower, + // so a high bank can be cut as deep as the ground beside it and a trench through it never has to be a pond + P.digLow=function(i){var a=this.g0[i]-World.DIGMAX,f=this.def.digFloor;return f!=null&&f=0&&this.soft[i]&&!this.S.solid[i]&&!this.S.bar[i]&&this.S.g[i]>this.digLow(i)+0.01}; P.dig=function(x,z){var w=this,S=w.S,i=w.cell(x,z);if(!w.canDig(x,z))return false; - S.g[i]=Math.max(w.g0[i]-World.DIGMAX,S.g[i]-0.24);w.type[i]=T.SOIL;w.spoil++;w.dirty.push(i);S.wake(i); - var nb=[i-1,i+1,i-w.W,i+w.W];for(var m=0;m<4;m++){var j=nb[m];if(j>=0&&jS.g[i]+0.04){S.g[j]=Math.max(w.g0[j]-World.DIGMAX,Math.max(S.g[i]+0.04,S.g[j]-0.16));w.type[j]=T.SOIL;w.dirty.push(j);S.wake(j)}} + S.g[i]=Math.max(w.digLow(i),S.g[i]-0.24);w.type[i]=T.SOIL;w.spoil++;w.dirty.push(i);S.wake(i); + var nb=[i-1,i+1,i-w.W,i+w.W];for(var m=0;m<4;m++){var j=nb[m];if(j>=0&&jS.g[i]+0.04){S.g[j]=Math.max(w.digLow(j),Math.max(S.g[i]+0.04,S.g[j]-0.16));w.type[j]=T.SOIL;w.dirty.push(j);S.wake(j)}} return true}; P.canPile=function(x,z){var i=this.cell(x,z);return i>=0&&this.spoil>0&&this.soft[i]&&!this.S.solid[i]&&!this.S.bar[i]&&this.S.g[i]0){if(w.sink[p.hose.i]||w.hold[p.hose.i]>-1e8){w.removed+=got;p.away=true}else{S.add(p.hose.i,got);p.away=false}} p.flow+=(got/dt-p.flow)*0.2;p.run=true;p.why=got>q*0.05?'':'dry';return} p.flow*=0.8}; - World.DONE=0.03;World.DRAINX=2.5;World.PUMPX=2; // DRAINX, PUMPX: every drain and pump runs this many times its listed rate (raised 26 Nov 2026: draining felt slow) - World.SKIN=0.008;World.DIGMAX=0.9;World.BARH=0.36;World.T=T;World.CS=CS;World.vnoise=vnoise; + World.DONE=0.03;World.DRAINX=2.1;World.PUMPX=1.8; // DRAINX, PUMPX: every drain and pump runs this many times its listed rate (raised 26 Nov 2026: draining felt slow) + World.SKIN=0.008;World.DIGMAX=0.64;World.BARH=0.36;World.T=T;World.CS=CS;World.vnoise=vnoise; return {World:World,T:T,CS:CS}; })(); // The jobs. Sizes are in metres; x runs east, z runs south. Each build() lays out one place. @@ -348,7 +351,7 @@ var EWMaps=(function(){ function dist(x,z,a,b){return Math.sqrt((x-a)*(x-a)+(z-b)*(z-b))} var MAPS=[]; // 1. Marlow Row: a back yard. The patio drain is buried in leaves and the garden tap's pipe has split. - MAPS.push({id:'yard',name:'Marlow Row',sub:'Back yard',w:22,h:18,seed:11,pay:60,par:210,sky:'day', + MAPS.push({id:'yard',name:'Marlow Row',sub:'Back yard',w:22,h:18,seed:11,pay:60,par:150,sky:'day', brief:'The back yard has been under water since the storm, and it is not going down.', build:function(b){ b.ground(function(x,z){var h=dist(x,z,7,14.2);return 0.02*dist(x,z,8,6.5)+Math.max(0,z-9)*0.04-0.11*Math.max(0,1-h*h/0.81)+0.05*bump((h-1.15)/0.35)}); // and a hollow on the lawn with a lip round it: a puddle that cannot drain @@ -373,7 +376,7 @@ var EWMaps=(function(){ }}); function bump(u){return u<-1||u>1?0:1-u*u} // 2. Pell Street: shops, a forecourt, and a road whose gullies have vanished under the storm's leftovers. - MAPS.push({id:'street',name:'Pell Street',sub:'Shop fronts',w:24,h:20,seed:23,pay:110,par:300,sky:'day',needs:['rake','wrench'], + MAPS.push({id:'street',name:'Pell Street',sub:'Shop fronts',w:24,h:20,seed:23,pay:110,par:240,sky:'day',needs:['rake','wrench'], brief:'The road outside the shops is a pond and the loading bay has filled to the brim.', build:function(b){ b.ground(function(x,z){ @@ -388,18 +391,18 @@ var EWMaps=(function(){ b.wall(0,3,0.5,20,2.2,0x3d5a73,'fence');b.wall(23.5,3,24,20,2.2,0x3d5a73,'fence');b.wall(0,19.5,24,20,5.0,0x9b8f80,'houseN'); b.wall(2,3,3.5,3.5,0.9,0x3f6b4c,'bin');b.wall(9,3,10,4,0.75,0x7a5a3c,'planter');b.wall(15,5,16,6,0.7,0x8a6a3a,'crate');b.wall(18.5,4.5,19.5,5.5,1.0,0x7b6a55,'crate'); b.wall(14,4,14.5,8.5,1.0,0x6d7478,'rail');b.wall(19.5,4,20,8.5,1.0,0x6d7478,'rail');b.wall(14,4,20,4.5,1.0,0x6d7478,'rail'); - b.drain(5,13.4,{rate:0.15,cap:12});b.drain(19,13.4,{rate:0.15,cap:12});b.drain(17,6.5,{rate:0.05,cap:8}); + b.drain(5,13.4,{rate:0.15,cap:12});b.drain(19,13.4,{rate:0.15,cap:12});b.drain(17,6.5,{rate:0.035,cap:8}); b.leak(16.75,4.75,{rate:0.012,wrench:true,y:1.1,nz:1,pz:4.52,label:'Dripping joint'}); - b.litter(5,13.4,0.75,15);b.litter(19,13.4,0.75,14);b.litter(17,6.5,0.7,10);b.litter(12,15,7,16);b.litter(17,7,2,5); - b.flood(0,0,24,20,0.25);b.flood(6,6.5,10,9.5,0.275); + b.litter(5,13.4,0.75,15);b.litter(19,13.4,0.75,14);b.litter(17,6.5,0.7,10);b.litter(12,15,7,26);b.litter(17,7,2,8);b.litter(6,16,3,8);b.litter(18,17,3,8); // plenty more floating about to wash back onto the gullies + b.flood(0,0,24,20,0.31);b.flood(6,6.5,10,9.5,0.31); b.spot(17,9.5,3,'The loading bay is lower than everything around it. It has a small drain of its own somewhere under that water.');b.spot(8,8,2.2,'A dip in the paving. It will hold a puddle whatever the drains do.');b.spot(12,13.4,4,'A road like this has gullies along the kerb. None are showing.'); b.spawnAt(2,9,-Math.PI/2); }}); // 3. Tanners Field: allotments in a hollow. No drain at all: the only way out is over, or through, the bank. - MAPS.push({id:'field',name:'Tanners Field',sub:'Allotments',w:34,h:24,seed:31,pay:160,par:420,sky:'day',needs:['shovel','rake'], + MAPS.push({id:'field',name:'Tanners Field',sub:'Allotments',w:34,h:24,seed:31,pay:160,par:380,digFloor:-0.5,sky:'day',needs:['shovel','rake'], brief:'The allotments sit in a hollow. The water came in and has nowhere to go.', build:function(b){ - b.ground(function(x,z){var dt=-0.5-0.025*z;if(x>=30.5)return dt-0.12*bump((x-32)/1.5);var g=0.30+0.012*dist(x,z,22,12)+0.012*Math.max(0,22-x)/6+0.035*Math.min(1,Math.abs(z-12.25)/4)+0.30*bump((x-28.75)/1.25);if(x>30)g=g+(x-30)*2*(dt-g);return g}); + b.ground(function(x,z){var dt=-0.5-0.025*z;if(x>=30.5)return dt-0.12*bump((x-32)/1.5);var g=0.30+0.015*dist(x,z,22,12)+0.30*bump((x-28.75)/1.25);if(x>30)g=g+(x-30)*2*(dt-g);return g}); b.surf(0,0,34,24,T.GRASS,1); for(var k=0;k<4;k++)for(var j=0;j<3;j++)b.surf(3+k*6,5+j*6,7.5+k*6,9.5+j*6,T.SOIL,1); b.surf(30.5,0,34,24,T.GRAVEL,0); @@ -409,16 +412,15 @@ var EWMaps=(function(){ b.noJob(30.5,0.5,33.5,23.5); // water in the ditch is on its way out: it does not count b.sinkArea(30.5,22.5,33.5,23.5); // the ditch runs south along the hedge and leaves under it at the far end, so water can be seen running along it b.drain(26.25,18.25,{rate:0.05,cap:9,kind:'culvert',pipe:[27.0,30.9]}); // pipe: drawn from the grate through the bank (x from, x to) - b.deco(21.5,11.5,'pegs',{x1:30.2});b.deco(21.5,13.0,'pegs',{x1:30.2}); // orange pegs and string either side of where the trench should go b.valve(6.02,2,'sp',{nx:1,y:0.8});b.leak(6.75,2.25,{rate:0.03,valve:'sp',y:0.7,nx:1,px:6.02,pz:2.5,label:'Standpipe'}); b.sign(6.02,1.4,'STANDPIPE',{nx:1,y:1.4}); b.litter(26.25,18.25,0.75,12);b.litter(22,12,8,14); - b.flood(0,0,30,24,0.43); + b.flood(0,0,30,24,0.48); b.spot(22,12,4,'The lowest point of the field, and there is no drain anywhere on it.');b.spot(28,12,3,'A bank. On the far side the ground drops into a ditch that is nearly empty.');b.spot(26.25,18.25,3,'A small pipe runs under the bank here. It is choked, and it sits too high to empty the middle of the field.'); b.spawnAt(4,5,Math.PI*0.75+Math.PI); }}); // 4. Fenny Underpass: the road dips under a bridge. The sump pump is dead, so nothing leaves by itself. - MAPS.push({id:'under',name:'Fenny Underpass',sub:'Road under the bridge',w:12,h:30,seed:41,pay:220,par:380,sky:'day',needs:['pump','rake'], + MAPS.push({id:'under',name:'Fenny Underpass',sub:'Road under the bridge',w:12,h:30,seed:41,pay:220,par:290,sky:'day',needs:['pump','rake'], brief:'The road under the bridge is shut. The council says its pump has given up.', build:function(b){ b.ground(function(x,z){var u=(z-15)/8;if(u>-1&&u<1)return -0.9*(1-u*u);if(z<=7)return -0.03*(7-z);return 0.02*(z-23)}); @@ -437,7 +439,7 @@ var EWMaps=(function(){ b.spawnAt(6,3.5,Math.PI); }}); // 5. Wharf Cellar: below the river's level. Water seeps in through the light well as fast as you take it out. - MAPS.push({id:'cellar',name:'Wharf Cellar',sub:'Warehouse cellar',w:16,h:14,seed:53,pay:280,par:400,sky:'cellar',needs:['pump','sandbags','wrench'], + MAPS.push({id:'cellar',name:'Wharf Cellar',sub:'Warehouse cellar',w:16,h:14,seed:53,pay:280,par:310,sky:'cellar',needs:['pump','sandbags','wrench'], brief:'The cellar under the old wharf keeps filling. The owner has bailed it twice already.', build:function(b){ b.ground(function(x,z){if(x>=9.5&&x<11.5&&z<5){return z<1.5?1.5:0.07+(5-z)/3.5*1.43}if(x>=12)return 0;return 0.02*dist(x,z,7,8.5)}); @@ -459,7 +461,7 @@ var EWMaps=(function(){ b.spawnAt(10.5,1.6,Math.PI); }}); // 6. Mill Lane: the stream has broken its bank and is still coming. - MAPS.push({id:'mill',name:'Mill Lane',sub:'Lane by the stream',w:30,h:24,seed:67,pay:400,par:540,sky:'day',needs:['sandbags','rake','pump','generator','shovel'], + MAPS.push({id:'mill',name:'Mill Lane',sub:'Lane by the stream',w:30,h:24,seed:67,pay:400,par:480,sky:'day',needs:['sandbags','rake','pump','generator','shovel'], brief:'The mill stream is through its bank and the whole lane is under. Start with whatever is still feeding it.', build:function(b){ b.ground(function(x,z){ diff --git a/e63334287a3deaa3/ebbwork/es.js b/e63334287a3deaa3/ebbwork/es.js index b086d236..d53c778c 100644 --- a/e63334287a3deaa3/ebbwork/es.js +++ b/e63334287a3deaa3/ebbwork/es.js @@ -209,27 +209,14 @@ if (window.BackRoomLang) BackRoomLang.add({ 'Click: put it down, then click where the hose empties · Right click: pick up': 'Clic: colocarla y luego clic donde vacía la manguera · Clic derecho: levantar', 'Click: put it down somewhere dry · Right click: pick up': 'Clic: colocarlo en un lugar seco · Clic derecho: levantar', 'Move with W A S D. Look with the mouse.': 'Muévete con W A S D. Mira con el mouse.', - 'Find the drain under the leaves': 'Encuentra el desagüe bajo las hojas', - 'Click to rake the leaves off the drain': 'Haz clic para quitar las hojas del desagüe', - 'Water is still pouring in. Follow the copper pipe to its tap': 'Sigue entrando agua. Sigue el caño de cobre hasta su llave', - 'Hold E to shut the tap': 'Mantén E para cerrar la llave', - 'Keep the drain clear until the yard is dry': 'Mantén despejado el desagüe hasta que el patio esté seco', - 'A joint on the copper pipe is dripping. Press 2 for the wrench and hold click on it': 'Una junta del caño de cobre gotea. Pulsa 2 para la llave inglesa y mantén el clic sobre ella', - 'A joint on the copper pipe is dripping. Tap the wrench at the top, then hold Use on it': 'Una junta del caño de cobre gotea. Toca la llave inglesa arriba y mantén Usar sobre ella', - 'Another drain is blocked, by the side path. Press 1 for the rake and clear it': 'Hay otro desagüe tapado, junto al camino lateral. Pulsa 1 para el rastrillo y despéjalo', - 'Another drain is blocked, by the side path. Tap the rake and clear it': 'Hay otro desagüe tapado, junto al camino lateral. Toca el rastrillo y despéjalo', - 'The puddle in the lawn has no way out. Press 3 for the bucket: fill it there, then tip it out over a drain': 'El charco del césped no tiene salida. Pulsa 3 para el cubo: llénalo ahí y vacíalo sobre un desagüe', - 'The puddle in the lawn has no way out. Tap the bucket: fill it there, then tip it out over a drain': 'El charco del césped no tiene salida. Toca el cubo: llénalo ahí y vacíalo sobre un desagüe', - 'Keep the drains clear until the yard is dry': 'Mantén despejados los desagües hasta que el patio esté seco', - 'Shut the standpipe by the shed first': 'Primero cierra la toma de agua junto al cobertizo', - 'This field has no drain. Follow the orange pegs to the bank': 'Este campo no tiene desagüe. Sigue las estacas naranjas hasta el talud', - 'This job needs a shovel. Buy one at the gear bench in the depot': 'Este trabajo necesita una pala. Compra una en el banco de equipo del depósito', - 'Pick the shovel and dig between the pegs, right through the bank to the ditch': 'Toma la pala y cava entre las estacas, atravesando el talud hasta la zanja', - 'Water is running into the ditch. Carry the trench back to the middle of the field: one dig deep is enough there': 'El agua ya corre hacia la zanja. Lleva el canal hasta el centro del campo: con cavar una vez basta ahí', - 'Keep the trench running until the field is dry': 'Mantén el canal corriendo hasta que el campo esté seco', + 'Rake the leaves off the drain': 'Quita con el rastrillo las hojas del desagüe', + 'Water is still coming in. Shut it off at the tap': 'Sigue entrando agua. Ciérrala en la llave', + 'Something is still dripping. Wrench: key 2': 'Algo sigue goteando. Llave inglesa: tecla 2', + 'Something is still dripping. Use the wrench': 'Algo sigue goteando. Usa la llave inglesa', + 'One puddle has no way out. Bucket: key 3': 'Hay un charco sin salida. Cubo: tecla 3', + 'One puddle has no way out. Use the bucket': 'Hay un charco sin salida. Usa el cubo', + 'The water has stopped going down. Find where it stands in your trench and dig the high part deeper': 'El agua ha dejado de bajar. Busca dónde se queda en tu canal y cava más hondo la parte alta', 'Left thumb walks. Drag to look.': 'El pulgar izquierdo camina. Arrastra para mirar.', - 'Tap Use to rake the leaves off the drain': 'Toca Usar para quitar las hojas del desagüe', - 'Hold Do to shut the tap': 'Mantén Hacer para cerrar la llave', 'Still filling': 'Sigue entrando', 'The Depot': 'El depósito', 'The storm has gone. The water has not.': 'La tormenta ya pasó. El agua no.', diff --git a/e63334287a3deaa3/ebbwork/game.js b/e63334287a3deaa3/ebbwork/game.js index c97c3706..ce0ceaeb 100644 --- a/e63334287a3deaa3/ebbwork/game.js +++ b/e63334287a3deaa3/ebbwork/game.js @@ -508,30 +508,20 @@ function openJournal(){$('jTitle').textContent=def.name;$('jBrief').textContent= if(notes.length)h+='
  • '+esc(T('What you have noticed'))+notes.map(function(n){return'• '+esc(n)+''}).join('')+'
  • '; $('jTasks').innerHTML=h;show('journal')} // Guided jobs teach by doing: one short line at a time, gone as soon as it is done. The first job (Marlow Row) walks -// through the starting tools one by one; Tanners Field, the first job with no drain at all, gets its own short guide. +// through the starting tools one by one, in as few words as it can. Later jobs have no guide: their notes and the hint below. // A guide runs until the job has a star. A step's `give` adds that tool to the bar when the step starts, and the job -// cannot finish while a guide is still running (its last step is "until it is dry"). +// cannot finish while a guide is still running (the yard waits for its lawn puddle). function hollowLeft(){var S=world.S,t=0;for(var z=26;z<31;z++)for(var x=11;x<17;x++){var i=z*world.W+x;if(Math.hypot((x+0.5)*0.5-7,(z+0.5)*0.5-14.2)<1.0)t+=S.d[i]}return t*0.25} var GUIDES={ yard:[ {t:'Move with W A S D. Look with the mouse.',tt:'Left thumb walks. Drag to look.',ok:function(){return pl.walked>2.5}}, - {t:'Find the drain under the leaves',ok:function(){return seen.d0}}, - {t:'Click to rake the leaves off the drain',tt:'Tap Use to rake the leaves off the drain',ok:function(){return world.drains[0].clear>0.85}}, - {t:function(){var v=world.valves[0],nearTap=Math.hypot(v.x-pl.x,v.z-pl.z)<3.4;return nearTap?(touchUI?'Hold Do to shut the tap':'Hold E to shut the tap'):'Water is still pouring in. Follow the copper pipe to its tap'},ok:function(){return !world.leaks[0].on}}, - {give:'wrench',t:'A joint on the copper pipe is dripping. Press 2 for the wrench and hold click on it',tt:'A joint on the copper pipe is dripping. Tap the wrench at the top, then hold Use on it',ok:function(){return world.leaks[1].fixed}}, - {t:'Another drain is blocked, by the side path. Press 1 for the rake and clear it',tt:'Another drain is blocked, by the side path. Tap the rake and clear it',ok:function(){return world.drains[1].clear>0.85}}, - {give:'bucket',t:'The puddle in the lawn has no way out. Press 3 for the bucket: fill it there, then tip it out over a drain',tt:'The puddle in the lawn has no way out. Tap the bucket: fill it there, then tip it out over a drain',ok:function(){return hollowLeft()<0.025}}, - {t:'Keep the drains clear until the yard is dry',ok:function(){return world.isDone()}} - ], - field:[ - {t:'Shut the standpipe by the shed first',ok:function(){return !world.leaks[0].on}}, - {t:'This field has no drain. Follow the orange pegs to the bank',ok:function(){return Math.hypot(pl.x-26,pl.z-12.25)<3.5}}, - {t:function(){return bar.indexOf('shovel')<0?'This job needs a shovel. Buy one at the gear bench in the depot':'Pick the shovel and dig between the pegs, right through the bank to the ditch'},ok:function(){return world.removed>0.25}}, - {t:'Water is running into the ditch. Carry the trench back to the middle of the field: one dig deep is enough there',ok:function(){return world.fraction()<0.4}}, - {t:'Keep the trench running until the field is dry',ok:function(){return world.isDone()}} + {t:'Rake the leaves off the drain',ok:function(){return world.drains[0].clear>0.85}}, + {t:'Water is still coming in. Shut it off at the tap',ok:function(){return !world.leaks[0].on}}, + {give:'wrench',t:'Something is still dripping. Wrench: key 2',tt:'Something is still dripping. Use the wrench',ok:function(){return world.leaks[1].fixed}}, + {give:'bucket',t:'One puddle has no way out. Bucket: key 3',tt:'One puddle has no way out. Use the bucket',ok:function(){return hollowLeft()<0.025}} ] }; -var TUT=null,tutK=-1,depotSay=''; +var TUT=null,tutK=-1,depotSay='',stuck={t:0,f:1,said:0}; function tutStart(){var st=TUT&&TUT[tutK];if(st&&st.give&&bar.indexOf(st.give)<0&&GEARBY[st.give]){bar.push(st.give);buildBar();hands.root.visible=true;$('hot').hidden=false}} var wasClear=[]; function updateHud(dt){ @@ -547,6 +537,9 @@ function updateHud(dt){ world.leaks.forEach(function(l,k){if(!seen['l'+k]&&l.on&&Math.hypot(l.x-pl.x,l.z-pl.z)<4.2){seen['l'+k]=1;if(tutK<0)toast(l.wrench?T('A joint is dripping steadily here.'):T('Water is pouring out of a split pipe here.'),3.5)}}); if(tutK<0||def.id!=='yard')world.spots.forEach(function(s){if(!s.seen&&Math.hypot(s.x-pl.x,s.z-pl.z)0&&!stuck.said){var fr_=world.fraction();if(fr_40&&!world.incoming()&&!world.isDone()){stuck.said=1;toast(T('The water has stopped going down. Find where it stands in your trench and dig the high part deeper'),7)}} if(tutK>=0&&TUT[tutK].ok()){tutK++;sfx('good',0.8);if(tutK>=TUT.length){tutK=-1;if(def.id==='yard'){save.tut=1;persist()}}else tutStart()} if(toastT>0)toastT-=dt; var tl=tutK>=0?TUT[tutK]:null,line=tl?T(typeof tl.t==='function'?tl.t():touchUI&&tl.tt?tl.tt:tl.t):toastT>0?toastTx:def.depot?depotSay:'',sy=$('say'); @@ -554,7 +547,7 @@ function updateHud(dt){ // prompt focus=findFocus();var p=$('prompt'),tap=touchUI?T('Do'):'E',act=touchUI?T('Hold Do'):T('Hold E'),txt=''; if(focus){var o=focus.o; - if(focus.kind==='valve')txt=tutK>=0&&def.id==='yard'?'':act+': '+(o.closed?T('open the tap'):T('shut the tap')); + if(focus.kind==='valve')txt=act+': '+(o.closed?T('open the tap'):T('shut the tap')); else if(focus.kind==='leak')txt=tool()==='wrench'?(touchUI?T('Hold Use'):T('Hold click'))+': '+T('tighten the joint'):T('A dripping joint. It needs the wrench.'); else if(focus.kind==='pump')txt=pumpWhy(o)+' '+tap+': '+(o.on?T('switch off'):T('switch on')); else if(focus.kind==='station')txt=tap+': '+(o.kind==='board'?T('pick a job'):o.kind==='shop'?T('buy gear'):T('load the van')); @@ -585,7 +578,7 @@ function enter(d){ bar=def.depot?[]:first?['rake']:vanNeeded()?save.load.filter(function(t){return save.gear[t]}):own; if(!def.depot&&captain()){var need=def.needs||[];bar=GEAR.filter(function(g){return g.slot&&(bar.indexOf(g.id)>=0||need.indexOf(g.id)>=0)}).map(function(g){return g.id})} inv={};if(bar.indexOf('sandbags')>=0)inv.sandbags=save.gear.bags2?8:4;if(bar.indexOf('pump')>=0)inv.pump=save.gear.pump2?2:1;if(bar.indexOf('generator')>=0)inv.generator=1;if(bar.indexOf('sack')>=0)inv.sack=40; - cur=0;bucketVol=0;seen={};notes=[];endT=0;scanT=0;scanCool=0;hold=0;acc=0;rot=0;hosePump=null;dynDirty=true;inp.crouch=false;toastT=0;wasClear=world.drains.map(function(dr){return dr.clear>=0.55}); + cur=0;bucketVol=0;seen={};stuck={t:0,f:1,said:0};notes=[];endT=0;scanT=0;scanCool=0;hold=0;acc=0;rot=0;hosePump=null;dynDirty=true;inp.crouch=false;toastT=0;wasClear=world.drains.map(function(dr){return dr.clear>=0.55}); TUT=def.depot?null:GUIDES[def.id]||null;tutK=TUT&&!(save.jobs[def.id]&&save.jobs[def.id].stars)?0:-1; buildBar();hands.root.visible=bar.length>0;$('hud').hidden=false;coinsTx(); $('bar').hidden=!!def.depot;$('place').hidden=!def.depot;$('coins').hidden=!(def.depot&&shopOpen());$('bScan').hidden=$('bJournal').hidden=!!def.depot||first;$('inflow').hidden=true;$('hot').hidden=!bar.length; diff --git a/e63334287a3deaa3/news/ngcoding10-flood-harder.json b/e63334287a3deaa3/news/ngcoding10-flood-harder.json new file mode 100644 index 00000000..a2386e4c --- /dev/null +++ b/e63334287a3deaa3/news/ngcoding10-flood-harder.json @@ -0,0 +1,19 @@ +{ + "kind": "feature", + "title": "Flood Crew: tougher jobs, fewer hints", + "tags": ["Flood Crew"], + "items": [ + "The first job says much less: just a few short lines, and you find the rest yourself.", + "Tanners Field has no pegs or step-by-step lines any more, but it can always be finished now: if water sits in your trench, dig the high part deeper.", + "Pell Street is harder: deeper water and more rubbish that washes back onto the drains.", + "Water drains a little slower, and the target times for three stars are tighter." + ], + "es": { + "Flood Crew: tougher jobs, fewer hints": "Flood Crew: trabajos más duros, menos pistas", + "Flood Crew": "Flood Crew", + "The first job says much less: just a few short lines, and you find the rest yourself.": "El primer trabajo dice mucho menos: solo unas frases cortas, y el resto lo descubres tú.", + "Tanners Field has no pegs or step-by-step lines any more, but it can always be finished now: if water sits in your trench, dig the high part deeper.": "Tanners Field ya no tiene estacas ni instrucciones paso a paso, pero ahora siempre se puede terminar: si el agua se queda en tu canal, cava más hondo la parte alta.", + "Pell Street is harder: deeper water and more rubbish that washes back onto the drains.": "Pell Street es más difícil: el agua es más profunda y hay más basura que vuelve a tapar los desagües.", + "Water drains a little slower, and the target times for three stars are tighter.": "El agua baja un poco más despacio y los tiempos para tres estrellas son más ajustados." + } +}