“String Avoider” HTML5 game prototype now featuring levels and better graphics with a gradient background

Are you enjoying my String Avoider prototype tutorials?

Let’s make a small recap of what we hade done so far using Phaser:

In step 1 the game engine has been updated from an old 2.2.1 version to the latest official Phaser version which is 2.6.2 and it’s the last one before Phaser 3.

In step 2 the game was optimized to make it smoother to play on mobile devices.

In step 3 we added a powerup because we all love games with powerups.

Now it’s time to complete the prototype by adding levels and a nice background gradient which is made on the fly thanks to Phaser graphic methods. Every line of the source code is commented, so don’t be afraid to miss something, you won’t.

Here is the game, currently with three cycling levels:

Touch the canvas, and “start” circle will disappear revealing the string, drag your finger anywhere and see how the string follows your finger movements. Reach the end to advance to next level. If you have a mobile phone, you can play the game directly on this page.

And this is the line by line commented source code, have fun with it:

As usual I am also providing you the full source code for you to enjoy and create your own game. If you manage to create something interesting, just let me know and I will be happy to show it on the blog.