anvilsign in

collin/mahjong · 8e93cfa1

Let a thrown tile stay face up on its way in

Collin Richards · 2026-08-19 21:25 UTC · 8e93cfa1e1b3ec8290dcaae374c8d890d0f60a91 · parent 582ad803 · browse files

modifiedTODO.md+1 −0
⋯ 24 unchanged lines
2525 - [ ] fgure out the br nao
2626 - [ ] computer shouldn't be able to take the pung before the throw animation completes
2727 - [ ] weirdness around throwing the tiles in the center, it's like attracted to the center, even gets stopped by wall it keeps going
28+- [ ] put the tumble back on a thrown tile — `TUMBLE` in `src/table/pool.ts`
modifiedsrc/table/pool.ts+12 −1
⋯ 62 unchanged lines
6363 }
6464
6565 /**
66+ * Whether a tile turns over on its way in.
67+ *
68+ * Off for now. Like `LOB_WHEN_WALLED` below, the tumble is kept whole — the
69+ * flip is a real axis in `physics.ts` and the renderer already squashes the
70+ * tile along it — and this is the only switch that reaches it, so putting it
71+ * back is one word rather than a rewrite.
72+ */
73+const TUMBLE: boolean = false;
74+
75+/**
6676 * Whether a wall standing in the way turns a discard into a lob over the top
6777 * rather than a flick across the table.
6878 *
⋯ 415 unchanged lines
484494 flipOver = hop;
485495 flipTurns = speed > 2200 ? 2 : speed > 600 ? 1 : 0;
486496 }
497+ if (!TUMBLE) flipTurns = 0;
487498
488499 return addBody(this.world!, {
489500 tile: a.tile,
⋯ 41 unchanged lines
531542 angle: (rng() - 0.5) * Math.PI,
532543 spin: (rng() - 0.5) * (open ? 7 : 2.5),
533544 // It turns over on its way in, whichever way it is going.
534- flipTurns: 1,
545+ flipTurns: TUMBLE ? 1 : 0,
535546 flipOver: flight,
536547 flipAxis: Math.atan2(vy, vx),
537548 w: geo.tile.w,
⋯ 20 unchanged lines