TinyGames · how it works
Turn two cards, keep them if they match. The board is dealt so that no run is decided before it starts, and the score rewards remembering rather than luck.
Draft. It is built, compiled and tested like every other game, and it is
not on the hub: "draft": true in build/games.json keeps it off the cards,
out of the sitemap and without a readme page until the rules are real. Take the
flag off when it is worth playing.
pairs.ts is the rules and touches nothing - no canvas, no engine, no
storage. memory.ts is everything that draws or listens. The split is what
makes the hard half testable: node test-pairs.js runs against the shipped,
minified JavaScript rather than the source, which is how a minification fault
gets caught.
Every screen except the run itself belongs to the shared shell, so this game
has one scene of its own, play. The menu, the pause card, the game-over
screen and the high-score table come from src/shared/scenes.ts and look and
behave the same here as in the other twenty.
src/memory/pairs.tsHUD.draw"draft": true off the entry in build/games.jsonAdvertisement