A flashcard game, balanced by a bot and shipped as its own app

Brain Defense, a tower defense game where the gold comes from answering flashcard questions, built for the Braineos web app and then released as its own Android app without writing a second game.

Problem

Braineos learners study the same decks again and again. A game could make that practice more fun, but gold in a quiz game arrives only as fast as someone answers questions, so the usual tower defense numbers don’t hold. And the game had to stay a way to study, not a shortcut up the streaks and leaderboard.

What we built

  • A game engine in plain TypeScript with no canvas, DOM or timers: one deterministic step function, given a seeded random source, so it can run anywhere and be tested.
  • A scripted bot that plays whole games headless, answering at a set pace and accuracy, to tune the balance across many seeds before anyone playtested it.
  • Any deck plays: flashcards become four-option questions using definitions from other cards in the deck, and a missed question comes back a few questions later.
  • A score that can’t game the app: a run counts the different cards answered right, the same ceiling as a study session.
  • Castle art added later as a drawing-only change: every sprite is SVG path data in one module, so no rule of the game changed.
  • A separate Android app: the rules copied across byte for byte with their tests, the drawing rebuilt on Skia, signing in with the same Braineos account.

Result

Brain Defense is on Google Play with three levels of ten waves, and the same game runs on the Braineos website. The Android launch shipped with exactly the tuning the web version had already been balanced with.

Have something similar in mind?

Start a project