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 | |||
| 25 | 25 | - [ ] fgure out the br nao | |
| 26 | 26 | - [ ] computer shouldn't be able to take the pung before the throw animation completes | |
| 27 | 27 | - [ ] 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 | |||
| 63 | 63 | } | |
| 64 | 64 | ||
| 65 | 65 | /** | |
| 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 | + | /** | |
| 66 | 76 | * Whether a wall standing in the way turns a discard into a lob over the top | |
| 67 | 77 | * rather than a flick across the table. | |
| 68 | 78 | * | |
| ⋯ 415 unchanged lines | |||
| 484 | 494 | flipOver = hop; | |
| 485 | 495 | flipTurns = speed > 2200 ? 2 : speed > 600 ? 1 : 0; | |
| 486 | 496 | } | |
| 497 | + | if (!TUMBLE) flipTurns = 0; | |
| 487 | 498 | ||
| 488 | 499 | return addBody(this.world!, { | |
| 489 | 500 | tile: a.tile, | |
| ⋯ 41 unchanged lines | |||
| 531 | 542 | angle: (rng() - 0.5) * Math.PI, | |
| 532 | 543 | spin: (rng() - 0.5) * (open ? 7 : 2.5), | |
| 533 | 544 | // It turns over on its way in, whichever way it is going. | |
| 534 | - | flipTurns: 1, | |
| 545 | + | flipTurns: TUMBLE ? 1 : 0, | |
| 535 | 546 | flipOver: flight, | |
| 536 | 547 | flipAxis: Math.atan2(vy, vx), | |
| 537 | 548 | w: geo.tile.w, | |
| ⋯ 20 unchanged lines | |||