Create HTML5 Vertical Endless Runner cross platform games

Using Phaser framework and other FREE software
Endless runner games are gaining more and more popularity and they are really easy to code.
I will take you by hand through the creation of a complete HTML5 vertical endless runner cross platform game with a lot of features and room for customization.
100 pages + 31 source code examples with a free update to come in a few days.

“Spellfall” HTML5 prototype made with Phaser updated to 2.8.2 and reusing tweens to improve performance

Emanuele Feronato Game design, HTML5, Javascript, Phaser

With the update of Phaser CE to 2.8.2, I am updating a 3 years old prototype – Spellfall – to the latest Phaser version, adding more comments to the source code and above all reusing tweens – actually, reusing THE tween – to save memory, CPU and improve performance.

Rather than creating a new tween at every player move, we create only one tween and update its target property according to the tile to be moved.

Also, a new to method is called each time to update tween destination. Finally, to prevent multiple to calls to create “waypoints” before the final tween destination, we have to reset its timeline property to an empty array.

This is very important, as I see people asking how to “reset” a tween destination in various threads and forums.

Well, just set timeline property to an empty array.

Let’s have a look at the result:

Just drag a tile over another tile to swap them. Yes, this is the simplest approach to a “match 3″ game design.

And now, the source code with all required comments:

Using only one tween for the entire prototype is a great improvement as it will save Phaser to manage garbage collection, resulting in an overall performance improvement as well as a good practice.

Next time I will add more animations, meanwhile you can download the source code.

Stay up to date
Follow me on the social networks and never miss a post.

Official Emanuele Feronato Facebook page

Official Emanuele Feronato Twitter account

From null to full HTML5 cross platform game

I will take you by hand from the bare bones of JavaScript programming through the creation of a full cross platform HTML5 game, with detailed explainations and source code.

If you don't know where to start, then From null to full HTML5 cross platform game is the book for you.

Leave a Reply

Your email address will not be published. Required fields are marked *