Complete Bejeweled prototype made with jQuery – updated to jQuery 2.0 and featuring swipe controls

More than two years ago I blogged about a complete Bejeweled prototype made with jQuery.

Now such prototype does not work anymore because I was using live() method which is now deprecated.

I could simply change a single line of the code replacing live() with on() but I wanted to something more interesting and also add swipe control using Matt Byrson’s TouchSwipe jQuery plugin.

I already used this plugin in the making of BWBan, a PuzzleScript HTML5 game ported to iOS with swipe control, and I have to say it’s the best jQuery plugin to handle swipes and other gestures.

So, this is what I made:

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

And this is the source code, with the new code highlighted:

I think I could to an entire Farm Heroes Saga game just using jQuery. Do you want me to try? Meanwhile, get the source code.

  • Max

    Thank you for this great tutorial, could you implement or explain how to implement the slide swap on the AS3 version?

  • jorge

    hola buenos dias queria saber si podrias decirme como hacerlo en flash,muchas gracias y muy buenos tutoriales .

  • coss

    Hey man can do you have a tutorial for this one cuz i cant find it.Thanks I am learnig from you.

  • Scott Kitney

    Hey your swipe control allows for diagonal swiping, but it’s not possible to do that when clicking target/destination. Is this intended? Thanks though, great work?

    • Emanuele Feronato

      no, it’s not, I’ll fix it