spencermcw.com
[ << ] back to work
case file 07 / 16 · 2022

Hatch Scratcher

The first game built for the CryptoZoo arcade.

live Live at hatch.spencermcw.com; source on GitHub. The CryptoZoo arcade it was built for is gone checked 2026-10-20 [1]

visit site (opens in a new tab)

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. [3]
  • Scratch to reveal the board, then settle results and roll over the balance. [7]
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 [8]
server Node · Express · express-session · connect-mongo · MongoDB · ethers.js 5 · seedrandom · decimal.js [9]
Tags
  • TypeScript
  • Web3
  • NoSQL
  • Game
Links
visit site (opens in a new tab)
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. [3]

  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%. [3]

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

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

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

  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. [7]

Languages, as GitHub reports them

by bytes [10]
  • 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) [11]
  2. Game and server source published to GitHub [2]

Every marked line above points at one of these: repositories and their docs, registries, live sites and screenshots. Nothing is inferred past what they show.

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