spencermcw.com
[ << ] back to work
case file 02 / 12 · 2022

Hatch Scratcher

The first game built for the CryptoZoo arcade.

retired Retired: the arcade and its deployment are gone; source on GitHub checked 2026-10-13 [1]

A scratch-card style wager game: pick animals, set a wager per square, begin the round and reveal the board, with balances and rollovers settled in $ZOO.

what it does

  • Connect a wallet, set a wager per square, and mark each square of a 50-square board with an animal or a rarity tier. [2]
  • Scratch to reveal the board, then settle results and roll over the balance. [6]
What it is
Browser wager game: a PixiJS client and an Express + MongoDB server
Stack
client PixiJS 6 · @pixi/sound · pixi-filters · Vue 3 · Vuex · ethers.js 5 · Vite [7]
server Node · Express · express-session · connect-mongo · MongoDB · ethers.js 5 · seedrandom · decimal.js [8]
Tags
  • TypeScript
  • Web3
  • NoSQL
  • Game
Links
Source >>
Arcade game template >>
  1. The server generates each board from seedrandom, seeded with the round's UUID plus a server secret, so any round can be regenerated from its id. [2]

  2. A square pays 0.95 divided by its hit probability, times the wager: an exact animal is 1 in 16; the five rarity tiers are 25/25/25/12.5/12.5%. [2]

  3. Payout math runs on decimal.js rather than floats. [2]

  4. Wallet sessions persist in MongoDB through express-session and connect-mongo, and CORS is pinned to the game's own origin. [4]

  5. A simulation script plays rounds through the same game module to check payouts. [5]

  6. The client is seven PixiJS scenes (splash, connect, loading, wager, scratcher, results, rollover) driven by the same scene manager as the arcade game template. [6]

Languages, as GitHub reports them

by bytes [9]
  • JavaScript 69%
  • PLSQL 30.1% not SQL: GitHub classifies TexturePacker's .tps sprite-sheet files as PL/SQL
  • HTML 0.4%
  • CSS 0.4%
$ git log --reverse
  1. Arcade game template published (PixiJS + Vite, a 768 x 1024 stage) [10]
  2. Game and server source published to GitHub [1]

Every marked line above points at one of these. Public repositories, registries and screenshots only; nothing is inferred past what they show.

  1. [1] spencermcw/hatch-scratcher on GitHub github.com 2026-10-13
  2. [2] server/hatchscratcher/game.js github.com 2026-10-13
  3. [3] server/hatchscratcher/animals.js github.com 2026-10-13
  4. [4] server/index.js github.com 2026-10-13
  5. [5] server/hatchscratcher/testing/sim.js github.com 2026-10-13
  6. [6] game/scripts/scenes github.com 2026-10-13
  7. [7] game/package.json github.com 2026-10-13
  8. [8] server/package.json github.com 2026-10-13
  9. [9] GitHub languages API api.github.com 2026-10-13
  10. [10] spencermcw/cz-arcade-game-template github.com 2026-10-13
  11. [11] BlockOpsDev/CryptoZoo, pull requests by spencermcw github.com 2026-10-13