All templates
Purrfect Rows
Cat vs dog line-making board game built with Phaser 3 - fill the grid, line up 3, 4 or 5 animals and outsmart the dog AI or a friend on the same device
HTML5 GamesPhaser 3board gametic tac toeline gamehtml5 game
$29
Purrfect Rows is a complete, ready-to-publish HTML5 board game where cute cats battle a clever dog. Players take turns filling a grid, and the first to line up 3, 4 or 5 matching animals horizontally, vertically or diagonally wins. Ships as clean, commented JavaScript source code (ES modules, no build step required) - reskin it, extend it, or publish it as-is on any website.
Highlights
- Three board presets, each with its own target row length: 3x3 (line up 3), 5x5 (line up 4) and 7x7 (line up 5)
- Vs Dog AI mode with three difficulties: Easy, Normal and Hard (depth-limited alpha-beta search with a time budget that always responds fast)
- Local 2-player mode: two people share one device, cats versus dogs
- Win detection in all directions (horizontal, vertical and both diagonals) plus draw detection when the grid fills up
- Result overlay with Rematch (starting animal alternates each rematch) and Change setup buttons
- Restart at any moment - safely cancels a pending AI move so the board is never corrupted
- Session and lifetime score tracking (cat wins, dog wins, draws) persisted in localStorage
- Separate sound effects and music toggles, both persisted between sessions
- Procedurally generated audio: every SFX and the looping music is synthesized with the Web Audio API - zero audio files
- Original SVG artwork generated in code and rasterized by Phaser - zero image files, crisp at any resolution
- Polish: bouncy piece placement, hover feedback, pulsing win-line glow, celebrating winner faces, paw particle bursts, blinking menu mascots
- Fully responsive portrait layout (900x1200, Scale.FIT) with mouse and touch support
- Screens: Loading, Main Menu (How to Play + Settings), Game Setup, Match, Result modal
Technology
- Phaser 3.80.1 bundled locally (no CDN), plain JavaScript ES modules - no bundler, no npm install needed
- Rules engine decoupled from rendering (BoardState, Rules, MatchController)
- Minimax AI with alpha-beta pruning, time budget and windowed positional heuristic
- Web Audio API synthesis for all SFX and music
- localStorage persistence for settings and lifetime stats
Requirements
- Any modern browser; any static web server for development or any static host to publish
- No accounts, no keys, no external requests at runtime
What You Get
- Complete readable source code: scenes, UI components, game logic, AI, audio and asset generators, all commented
- 18 passing Node.js logic tests plus a Playwright browser smoke test
- documentation.html with setup, structure and customization walkthroughs plus a publishing checklist
- Full rights to rebrand, reskin, extend and publish anywhere
Please note: this is a source code template, not a hosted game. Basic JavaScript knowledge is helpful for customization. If you have questions, use the contact form on the site, I usually reply within 24 hours.


