Mahjong is a game you hear before you see.
The clack of tiles hitting the table, the rattle of everyone washing the set together between hands. Most mahjong apps skip all of that and go straight to flat tiles on a grid. I wanted to see if a screen could get closer to the real table, so I built a 3D one with real physics.
It's the first piece of a mahjong app I'm building for beginners. Before designing the rules and tutorials, I wanted the core feel to be right.
1:1
Real-world scale, in centimetres
36
Tiles poured and washed in one go
0
Audio files. Every clack is synthesized
A felt table that behaves like the real thing
Everything runs live in the browser on desktop and phone. Tiles fall, bounce, stack and slide based on physics, not canned animations, so no two drops look the same.
Drop and pour
Drop single tiles (Red Dragon, Green Dragon, East Wind, Five of Dots, or a random mix), or pour a whole set face down the way it comes out of the box.
The Cantonese wash
Two palms swirl in opposite directions, drifting in and out across the felt, the way players mix a set between hands. You can also sweep the tiles yourself.
Pick up and flip
Drag any tile to slide it around, or tap it to flip it over. Tiles push each other out of the way as you move them.
Slow-mo and orbit
At real speed a drop is over in about a quarter of a second, so slow-mo lets you watch the tumble. Orbit and zoom to see the table from any angle.
The small decisions that make it feel right
Real units. The whole scene is in centimetres. Tiles are 26 × 35 × 20 mm and gravity is 982 cm/s², so drops land at the speed your eye expects. Tuning bounce and friction got much easier once the numbers matched the real world.
A tile built like a tile. Each one is a rounded, bevelled slab with an ivory face and a jade back, split crisply in the shader instead of using two separate pieces. The characters have a soft highlight above and a darker edge below, so they read as carved in rather than printed on.
Sound without recordings. Every sound is generated on the fly. Tile on felt is a low, muffled thud; tile on tile is a sharper click with a short woody ping. Volume follows how hard the tiles hit, so a gentle slide sounds different from a drop.
Making the hands visible. The palms that wash the tiles are invisible physics objects. On their own, the tiles looked like they were moving by themselves, so I drew each palm as a soft shadow on the felt. Now a sweep reads instantly.
The trickiest bug: after a few seconds, the washing hands stopped pushing tiles. The physics engine was putting the idle hands to "sleep" to save work, and they never woke back up. Keeping them awake fixed it.
Built for real people
- Every control is a real button with a label, so it works with a keyboard and screen readers.
- Two fingers orbit the camera on a phone, so one finger stays free for moving tiles.
- The pour speeds up when reduced motion is turned on, and sound only starts after you tap, never on page load.
From a table to a game that teaches you
Mahjong is hard to pick up. Rules vary between families, scoring is opaque, and most people learn by watching relatives play. The table is the first step toward an app that teaches Hong Kong mahjong while you play.
I've since built a playable web prototype with Claude: a full rules engine for one hand, scoring that explains every point in plain English, bots that suggest a discard and say why, and helper labels on every tile. It's covered by 41 tests, including a 1,000-hand simulation. Next is talking to beginners and using what I hear to design the guided tutorial.