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 #124

Parked opened this
Closed without merging

mason/pixel-plays:mason/114-main-is-red-espresso-bar-firefly-jar-sig → main 3 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
@@ -27,20 +27,8 @@ export const ROUNDS = {
2727 }
2828 g.step(1);
2929 } },
30 // pour while the cup is under the spout, and let go in time for the stream's tail to land on the line
3130 // build nothing, march nowhere, and give up: the second press of R confirms
3231 '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); } },
33 'espresso-bar': { over: /pour again/, outcome: /twenty cups poured · \d+/, beat: g => {
34 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)');
35 if (pour) g.keyDown(' '); else g.keyUp(' ');
36 g.step(1);
37 } },
38 // shoo any moth first, else catch a firefly that is glowing
39 'firefly-jar': { over: /another night/, outcome: /the night is survived · \d+ in the jar/, beat: g => {
40 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]; })()');
41 if (at) g.tap(at[0], at[1]);
42 g.step(2);
43 } },
4432 '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); } },
4533 // dive the way the taker leans, once the tell shows
4634 'goalkeeper': { over: /play again/, outcome: /you win: \d+ saves/, beat: g => {
@@ -79,19 +67,6 @@ export const ROUNDS = {
7967 };
8068 })() },
8169 'sled-run': { over: /ride again/, outcome: /[1-9]\d* m · \d+ clean/, beat: g => { g.hold(...MID, .6); g.run(.6); } },
82 // pull the lever the lamp showed for two trains, then a wrong one each turn until three trains are lost
83 'signal-box': { over: /run again/, outcome: /\d+ trains routed · the junction needs 8 to run on time/, beat: g => {
84 if (g.read('P.phase') === 'input') g.press(String((g.read('P.seq[P.got]') + (g.read('P.routed') < 2 ? 0 : 1)) % 5 + 1));
85 g.run(.3);
86 } },
87 // steer to the middle of the next gap in the bales
88 'soapbox-derby': { over: /roll again/, outcome: /banner! [\d.]+ s/, beat: g => {
89 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; })()');
90 const have = g.read('G.steer'), k = have < want - .04 ? 'ArrowRight' : have > want + .04 ? 'ArrowLeft' : null;
91 if (k) g.keyDown(k);
92 g.step(1);
93 if (k) g.keyUp(k);
94 } },
9570 '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); } },
9671 'stone-skip': { over: /play again/, outcome: /\d+ bounces/, beat: g => { g.drag([180, 140], [140, 170], .4); g.run(3); g.tap(...MID); } },
9772 // 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