Phaser 3 version of the HTML5 swipe controlled Sokoban game

With Phaser 3 release due for next week, while I will keep focusing on Phaser 2 too, since it’s widely used and it will continue to be used for a lot of months – that’s why I updated by first Phaser 2 book – it’s time to start to see what changed from Phaser 2 to Phaser 3 and how to build games with the new version.

Phaser 2 games won’t work on Phaser 3, so we need to rewrite most of the code.

The good news is it wont’ take a lot once you get used to the new syntax.

So I am showing you a Sokoban prototype controlled with swipes:

Swipe to control the character. You should know the rules. If you have a mobile device, you can play from this link.

And this is the source code. You can compare it with the Phaser 2 version to see what changed and how to make things work.

I did not include the “unlimited undo” feature as it’s pure JavaScript.

The code is still uncommented but I think you will find it useful anyway:

Next time I will add some comments to the code and most of all will update it to the first Phaser 3 release version, meanwhile download the source code.

Also don’t forget to get my book From null to full HTML5 cross platform game, big surprises await loyal readers once Phaser 3 is out, stable and widely used.

  • ?? ?????

    thank you. looking forward to commented version. Would be great if you could also explain the difference between phaser 2 and 3 versions to help migration. thank you!

    • Emanuele Feronato

      I will!! Of course.

  • ansimuz

    Thanks for this. At the moment there’s not much documentation around v3. It would great if you were planning to write a book or more tuts on Phaser v3.

    • Emanuele Feronato

      you’ll see a lot of stuff about Phaser 3, stay tuned.