Dominoes Game Source Code: Rules, CPU Rivals and 58 Tests Explained
What the Pip Club Dominoes package contains, which rules it plays, where to change texts and tiles, and what it leaves out.

Dominoes game source code looks simple until you check the edge cases. Who opens when nobody holds a double? What happens when the boneyard is empty and both players pass? How does the score work at the end of a blocked round? A template that answers those questions in code, and proves it with tests, is worth more than one with prettier tiles. Pip Club Dominoes, our double-six template, ships 58 automated tests that cover the rules, the computer opponent, the table layout, saving and the 14 translations.
This guide explains which rules the game plays, how the package is organised, what you can change with a text editor and what needs a rebuild, how to host it, and what the licence allows. File names come from the illustrated buyer guide that ships with the item.
One thing to know before anything else: Pip Club is played against the computer. It has no online mode and no two-player mode on one device.
The rules this dominoes game source code plays
Rules are where dominoes templates differ most, so check them against what your players expect. Pip Club plays a classic double-six block game, one player against one computer opponent.
- 28 tiles from 0 to 6. Each player gets 7 and the other 14 stay in the boneyard.
- The highest double opens. With no doubles, the highest total opens, and on a tie, the highest half.
- The table always has two ends, A and B. A tile must match an end, and zero matches zero.
- Doubles may sit crosswise, but they never branch and never give an extra turn.
- With no match, draw one tile at a time until you can play. With the boneyard empty and no match, pass.
- Domino: whoever empties their hand scores the total left in the opponent's hand.
- Lock: two passes in a row with an empty boneyard lock the table. The lower total wins the difference, and equal totals tie.
A Quick Round ends after one round. A Points Match plays rounds until someone reaches 50 or 100. The campaign has 9 encounters in 3 chapters, one per hangout, and every win earns a seal.
What comes in the package
Players face three computer opponents with their own personality: Rico the DJ raccoon, Faísca the skater fox and Nix the artist cat, each at Easy, Normal or Hard. Playable tiles glow, the table previews where a tile will land, and a hint suggests a move. There are three hangouts (Rooftop, Skate Park and Midnight Arcade), six collectible tile sets, campaign seals and statistics. Mouse, touch and keyboard all work.
- game/: the ready-to-host build, with index.html, pip.config.js, modules/, lib/, assets/ and licenses/.
- game/lib/phaser.js: Phaser 3.90.0, readable, under the MIT licence.
- source/: the editable TypeScript, art, music, translations and the automated tests.
- documentation/index.html and DOCUMENTATION.html: the buyer guide in 14 languages, which opens offline.
- THIRD-PARTY-LICENSES/: notices for Phaser and the Barlow Condensed font.
Artwork and music are original assets of the product, licensed to the buyer with the item. The interface comes in 14 languages and follows the browser language; there is no recorded voice, so every opponent line follows the chosen language.
See Pip Club Dominoes: demo, guide and price
Change it without a rebuild: pip.config.js
Next to index.html sits pip.config.js. Open it in any text editor, change a value, upload the file and reload. Three settings live there.
- title: the browser tab title.
- saveKey: the name the save is stored under. The default is pip-club.
- defaultLanguage: the starting language. Left empty, the game follows the browser.
Keep saveKey unchanged on a live site. A different key makes the game ignore existing progress and start a new save, which is useful for a second copy and painful for an update.
Where texts, art and tiles live in the source
- Texts and translations: source/src/ui/i18n.ts and source/src/ui/locales/.
- Character art, scenes and the logo: source/src/assets/club/.
- Music: source/src/assets/music/.
- Tile colours: source/src/art/palette.ts and source/src/art/tileArt.ts.
- Tests: source/tests/.
A typical branding job goes in this order: the logo and scene art in assets/club/, then the tile palette, then the wording in the locales. White label is allowed, so your brand can replace ours. Changing the computer's play or a rule is a deeper job; run the tests before and after, because they cover both.
If you are building a small catalogue of table games, two other templates of ours fit next to this one.
Ludo Cats: Ludo with kittens, CPU on three levels or friends on one device
Boba Club: Klondike solitaire with a 12-deal campaign
Rebuilding after you edit the TypeScript
The game/ folder is already built, so installing the game needs no Node.js. You only need it after changing the source.
- Install Node.js 22.12 or newer (the guide was tested with 22.23). npm comes with it.
- Open a terminal in source/, where package.json and package-lock.json are.
- Run npm ci. It installs the exact locked versions of Phaser, Vite, Vitest and TypeScript.
- Run npm test (58 tests) and npm run typecheck. Fix errors before you build.
- Run npm run build. The output is source/dist-static/, with index.html, modules/, lib/, assets/ and licenses/.
- Back up the hosted game, then upload the contents of dist-static/ exactly like game/.
The guide warns against npm audit fix and npm update, because they change the tested versions. If a package problem appears, restore the shipped package.json and package-lock.json pair.
Hosting it on your site
Upload only the contents of game/, so index.html sits directly in the target folder, for example public_html/games/pip-club/. Keep assets/, lib/, modules/, licenses/ and pip.config.js beside it and keep the letter case of every name. Do not upload source/, documentation/ or the ZIP.
- Any static HTTP(S) host works, in any subfolder of any domain, because the game uses relative paths.
- No database, PHP or Node.js service is needed to play.
- Opening index.html from your computer (file://) is not supported.
- The host must serve .js, .webp, .woff2 and .mp3 with normal types.
- The game makes no analytics, ranking, payment or advertising calls.
Saves stay in the player's browser, in IndexedDB or localStorage, and do not sync between devices. To update, upload the new game/ over the old one, keep pip.config.js and its saveKey, and clear cached files rather than site data if the old version still shows.
What it does not include, and the licence
The edition has no online or local two-player mode, no cloud saves, no online ranking, no real-money purchases and no advertising SDK. Native apps, hosting and custom development are also outside the package. Adding ads, a store or sync is developer work that needs your own accounts and approvals.
Pip Club lists at $49, which becomes $41.65 with the Black Friday promotion until 30 November 2026; a bundle discount of 5% to 20% applies when you buy two or more templates together. The licence is perpetual and non-exclusive, for one end product, yours or one client's. You may change the code, art and audio, put your brand on it and let players in free or with ads, but you may not resell the template or its code on their own. Support lasts six months, or twelve with the extension; anything beyond installing and fixing defects is quoted.
Read the licence and support terms
FAQ
Is the dominoes game source code TypeScript or JavaScript?
The source is readable, unminified TypeScript. The ready-to-host game/ folder is the built JavaScript, so you only need TypeScript tools to change the game.
Can two people play against each other?
No. Players face the computer opponents on one device. There is no online or local two-player mode.
Which domino variant does it play?
Classic double-six, one against one, with drawing from the boneyard, passing and a lock rule. Domino scores the opponent's remaining total, and a locked table goes to the lower total.
What can I change without rebuilding?
pip.config.js sets the browser title, the save key and the starting language. Rules, art, texts and music are changed in the source and need a rebuild.
Does it work offline?
It calls no external services, but it is not an installable offline app. Players need to reach your web address to load it.
Is this the dominoes base you need?
Pip Club fits a site or portal that wants a classic table game for all ages, a studio building a branded dominoes game for one client, and a developer who wants readable TypeScript with a computer opponent and real unit tests. It does not fit a project that needs people to play each other, online or on one screen; that is custom work from the start.
Play the Pip Club demo and buy the licence
Need a different rule set or several licences? Ask for a quote
