Complete Bejeweled prototype made with jQuery – updated to jQuery 3.2.1, improving swipe controls and working with any board size

It’s not a secret Bejeweled is the king of Match-3 games, and I made a lot of prototypes of this game, using various programming languages and frameworks, from ActionScript to Phaser, and even with jQuery.

Talking about jQuery version, the first prototype was made back in 2011, then I updated it with jQuery 2.0 in 2014 adding swipe controls using TouchSwipe.

The version I am going to show you today works with jQuery 3.2.1, TouchSwipe 1.6.18, has a better swipe control and works with any board size.

Look at a 6×7 board:

You know the rules, swap gems to match three or more of the same color. You can either click, drag, touch or swipe to play.

And this is the source code, uncommented at the moment because I want to add explosions when the player matches 4 or 5 gems with a single move, anyway if you read the entire series you should find the code quite familiar:

… and this is only a webpage with jQuery. Download the entire source code.