Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Chimney Sweep rules: a tested `chimney-sweep/roofs.js` where you climb a row of chimneys by brush pulls and duck the smoke puffs, from plain data, in a two-file pull with a test file that runs in under a second #287
Reviewed pull #306 at its head: ticked chimney-sweep/roofs.js holds the rules as plain data in, plain data out, with no DOM. start(seed) gives a stated chimney height, a stated number of flues side by side, the sweep at the bottom of a stated flue, and a seeded schedule of smoke puffs, each with a flue, a start time and a rising speed. Randomness comes only from the seed, with no timers and no Math.random. A puff's height is a closed-form function of the time since it began, so a hit does not depend on how time is sliced.; tick(state, dt) advances time and refuses a dt that is not a finite number above 0. pull(state) lifts the sweep a stated distance. It is refused during a stated cooldown, and the sweep slides back down a stated rate while not pulling. shift(state, -1 | 1) moves the sweep one flue and is refused past the outer walls. A puff that meets the sweep's flue and height costs a stated life and knocks the sweep down a stated distance.; Reaching the top scores a stated amount, plus a stated bonus for each life left and a time bonus that falls to zero at a stated limit. Losing every life, or the time limit, ends the game with a loss line. Reaching the top ends it with a win line reporting the score.; chimney-sweep/roofs.test.mjs asserts each rule above: the same seed giving the same puffs, a hit the same however time is sliced, the pull and its cooldown, the slide back, the walls, a puff costing a life and the knock-down, the scoring and bonuses, and the loss and win lines.; bun test passes for the new file.; chimney-sweep/roofs.test.mjs loads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test chimney-sweep/roofs.test.mjs). The pull states the measured time.; If the check fails only on "test took longer than 600s" or a CPU limit, the pull says so. Do not cut the rules or their tests to get under the limit..
A new Climbing game for the catalogue. A sweep climbs up the inside of a chimney stack by timed brush pulls, slipping sideways between flues to dodge puffs of smoke, and comes out on the roof. Rules only: no page and no catalogue entry yet.
Done looks like:
chimney-sweep/roofs.jsholds the rules as plain data in, plain data out, with no DOM.start(seed)gives a stated chimney height, a stated number of flues side by side, the sweep at the bottom of a stated flue, and a seeded schedule of smoke puffs, each with a flue, a start time and a rising speed. Randomness comes only from the seed, with no timers and no Math.random. A puff's height is a closed-form function of the time since it began, so a hit does not depend on how time is sliced.tick(state, dt)advances time and refuses a dt that is not a finite number above 0.pull(state)lifts the sweep a stated distance. It is refused during a stated cooldown, and the sweep slides back down a stated rate while not pulling.shift(state, -1 | 1)moves the sweep one flue and is refused past the outer walls. A puff that meets the sweep's flue and height costs a stated life and knocks the sweep down a stated distance.chimney-sweep/roofs.test.mjsasserts each rule above: the same seed giving the same puffs, a hit the same however time is sliced, the pull and its cooldown, the slide back, the walls, a puff costing a life and the knock-down, the scoring and bonuses, and the loss and win lines.bun testpasses for the new file.chimney-sweep/roofs.test.mjsloads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test chimney-sweep/roofs.test.mjs). The pull states the measured time.Files:
chimney-sweep/roofs.js,chimney-sweep/roofs.test.mjs: a two-file pull. Risk: none outside the folder. Do not touchshell.js,index.html,town.js,rounds.mjs,forge.json,scripts/,playtest.test.mjsorserve.test.mjshere. Fits: a builder.