Click a group of two or more adjacent tiles of the same color to remove them. Gravity pulls the remaining tiles down, empty columns collapse to the left, and the board keeps shrinking until nothing can be matched.

Scoring

Bigger groups are worth disproportionately more: removing n tiles scores n × (n − 1), multiplied by your current level. Clearing four tiles four times gives you 48 points. Clearing sixteen at once gives you 240. Patience pays.

Your best score is stored locally in your browser.

How to play

  • Click or tap a group of two or more matching tiles
  • Single tiles can't be removed
  • Run out of moves with tiles left on the board and the game restarts
  • Empty the board completely and you level up

Under the hood

The game logic lives in a headless TypeScript class that knows nothing about rendering. It only tracks tile types, computes the regions to remove, and returns the resulting changes: what was removed, what fell, what shifted. Phaser 4 takes that list and turns it into tweens.

The result is a renderer that's a few hundred lines long, and an engine you can drop into any project.

Source code

The complete project is available for download above: the Phaser 4 scene, the SameGame engine, the assets and the Vite setup.

Good starting point if you want to swap the tile art, change the board size, try a different gravity direction, or reuse the engine with a renderer of your own.

Built with Phaser 4, TypeScript and Vite.

Download

Download NowName your own price

Click download now to get access to the following files:

Phaser + TypeScript source code 34 kB

Leave a comment

Log in with itch.io to leave a comment.