Creating games

Guide for adding a new game to gameslib. For API details see Game object and Helpers.

Workflow

  1. Fork gameslib and work on the develop branch.
  2. Before first npm install, run npm run npm-login for GitHub Packages access.
  3. Create src/games/<uid>.ts extending GameBase (or GameBaseSimultaneous).
  4. Register in src/games/index.ts (import, type union, array entry, GameFactory case).
  5. Add i18n strings to locales/en/apgames.json (and apresults.json if needed).
  6. Flag new games with experimental in gameinfo.
  7. Test locally — Testing.
  8. PR against develop; test on play.dev.abstractplay.com after merge.

Implementation checklist

Start from /gameslib/templates/new-game-template.ts and Complica.

Choosing helpers

Most board games use either:

Use the examples by feature index to find games similar to yours.

Renderer

Implement render(opts?) returning APRenderRep for @abstractplay/renderer. Prototype JSON in the renderer playground.

Example games