Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

main is red: Espresso Bar, Firefly Jar, Signal Box and Soapbox Derby have no scripted round in rounds.mjs #137

Closed opened this
Closed without merging

mason/pixel-plays:mason/114-main-is-red-espresso-bar-firefly-jar-sig → main 8 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
1 file changed +0 −25
rounds.mjs −25
@@ -32,7 +32,6 @@ export const ROUNDS = {
3232 }
3333 g.step(1);
3434 } },
35 // pour while the cup is under the spout, and let go in time for the stream's tail to land on the line
3635 // build nothing, march nowhere, and give up: the second press of R confirms
3736 'empire': { over: /victory|defeat/, outcome: /defeat · you gave up at \d+:\d\d · \d+ trained, \d+ defeated/, beat: g => { g.drag([140, 120], [220, 200], .4); g.press('r'); g.run(.5); g.press('r'); g.run(.5); } },
3837 // turn two coats that do not match, again and again, until the thirteenth mismatch
@@ -41,17 +40,6 @@ export const ROUNDS = {
4140 if (pair) { g.tap(...pair[0]); g.tap(...pair[1]); }
4241 g.run(.9);
4342 } },
44 'espresso-bar': { over: /pour again/, outcome: /twenty cups poured · \d+/, beat: g => {
45 const pour = g.read('R.phase === "play" && !R.done && Math.abs(R.x) <= Pour.WINDOW && R.fill + Pour.RATE * Pour.DELAY < Pour.lineOf(R.cup)');
46 if (pour) g.keyDown(' '); else g.keyUp(' ');
47 g.step(1);
48 } },
49 // shoo any moth first, else catch a firefly that is glowing
50 'firefly-jar': { over: /another night/, outcome: /the night is survived · \d+ in the jar/, beat: g => {
51 const at = g.read('(() => { const t = Night.targets(R); const m = t.find(x => x.kind === "moth") || t.find(x => x.kind === "fly" && Night.glow(R.flies.find(f => f.id === x.id)).on); if (!m) return null; const p = scr(m.u, m.v, m.z); return [p.sx, p.sy]; })()');
52 if (at) g.tap(at[0], at[1]);
53 g.step(2);
54 } },
5543 'free-throw': { over: /play again/, outcome: /\d+ of 30/, beat: g => { g.hold(...MID, .6); g.run(.45); g.tap(...MID); g.run(1.5); g.tap(...MID); } },
5644 // dive the way the taker leans, once the tell shows
5745 'goalkeeper': { over: /play again/, outcome: /you win: \d+ saves/, beat: g => {
@@ -90,19 +78,6 @@ export const ROUNDS = {
9078 };
9179 })() },
9280 'sled-run': { over: /ride again/, outcome: /[1-9]\d* m · \d+ clean/, beat: g => { g.hold(...MID, .6); g.run(.6); } },
93 // pull the lever the lamp showed for two trains, then a wrong one each turn until three trains are lost
94 'signal-box': { over: /run again/, outcome: /\d+ trains routed · the junction needs 8 to run on time/, beat: g => {
95 if (g.read('P.phase') === 'input') g.press(String((g.read('P.seq[P.got]') + (g.read('P.routed') < 2 ? 0 : 1)) % 5 + 1));
96 g.run(.3);
97 } },
98 // steer to the middle of the next gap in the bales
99 'soapbox-derby': { over: /roll again/, outcome: /banner! [\d.]+ s/, beat: g => {
100 const want = g.read('(() => { for (let n = 0; n < Cart.GATES; n++) { const t = Cart.gateAt(n, R.seed); if (R.x < t.x + Cart.GATE_DEPTH + 1.6) return t.centre / Cart.LANE_MAX; } return 0; })()');
101 const have = g.read('G.steer'), k = have < want - .04 ? 'ArrowRight' : have > want + .04 ? 'ArrowLeft' : null;
102 if (k) g.keyDown(k);
103 g.step(1);
104 if (k) g.keyUp(k);
105 } },
10681 'stari-most': { over: /dive again/, outcome: /total [\d.]+/, beat: g => { g.hold(...MID, .4); g.run(.5); g.hold(...MID, .6); g.run(2); g.tap(...MID); } },
10782 'stone-skip': { over: /play again/, outcome: /\d+ bounces/, beat: g => { g.drag([180, 140], [140, 170], .4); g.run(3); g.tap(...MID); } },
10883 // pour each cup to its line: start as it slides under the spout, hold just long enough for the stream's tail to finish it

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs