Complete HTML5 SameGame game for you to play and download, featuring “no more moves” check

Here we are with the final step of SameGame series, a complete playable SameGame with high scores and a “no more moves” check.

The game features four colors and a 25×10 grid like in the original game, and the score is based on n * (n - 2) formula where n is the number of removed tiles.

Your best score is saved in local storage, have a go with the game:

To check if there are no more moves, after each player move I just loop through the game field performing flood fill on each tile. When I find a flood fill with two or more tiles, I break the loop and allow the player to continue.

Here is the source code:

Now you have zero excuses not to develop one of the 10 successful games you can easily create starting from the SameGame engine I blogged about yesterday.

Download the source code and start making games.

  • kad

    this looks like eating all memory.