HTML5 Drag and Match engine updated to Phaser 2.6.2 new feature added: checking for valid matches (and undo the move otherwise)

Here we go with another important feature to add to our Drag and Match engine update to Phaser 2.6.2

Today’s feature checks for valid matches after the player ends a move, performing an “undo” if the move did not make any match. In a Drag and Match engine, a valid match is made by three or more colors in a row, horizontally or vertically.

I borrowed some functions from my Bejeweled prototype to check for valid matches because there’s no need to reinvent the wheel.

Here we go with the game: there aren’t three-in-a-row matches and that’s not due to the randomness…

Now try to make a move, dragging with the finger or with the mouse, which does not form a valid match, and you’ll see the tiles come back to their original places with a blink effect, made using a yoyo tween. If you have a mobile device, you can play it directly from this link.

Have a look at the commented source code, which is growing bigger and bigger:

We are only a few steps away from having a complete working fully functional prototype, but you can download the source code and continue on your own. It would be great to see your results.

  • Shuang

    There is jitter, this can not handle with JS?