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.

“Mike Dangers” HTML5 game engine made with Phaser and ARCADE physics – optimizing the code and making the game fair

Emanuele Feronato Game design, HTML5, Javascript, Phaser

In this new chapter of the Mike Dangers series we are going to optimize the code and make the game fair.

Making a game fair is the top priority when you randomly generate levels. Players have to have the feeling they lost the game because they weren’t skilled enough – and they will retry – and not because the level was in some way impossible to solve.

In previous step, spikes are randomly placed on the floor, and sometimes – quite often actually – they are placed right at the end of a ladder, making the player crashing into them with no way to avoid them.

To prevent this, each time I place a ladder I create some kind of “safe area”, which means each ladder has a “spike-free” radius. Sme thing goes for the spikes, each spike has its own “spike-free” radius because we do not want two spikes being too close to each other.

Another important change is I do not longer use arrays to store floors, ladders and stuff. I only use arrays for the object pooling while in-game objects are only organized in groups. This won’t affect performance because we only have a few objects on the canvas, but will make the code more understandable and easier to port in other languages.

Last but not least, floors below the player won’t fall down anymore. It just does not feel realistic.

Now they simple scroll down, fading away into some kind of fog.

Well, have a look at the game:

Just tap or click to make the player jump. Try to climb the ladders and collect diamonds while avoding spikes. If you have a mobile device, you can play directly at this link.

Now, the source code, not that big for a complete prototype:

Less than 350 lines. I’ll try to add score management and a splash screen keeping the code below 350 lines, then will start commenting it line by line. Meanwhile, 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.

Comments 1

Leave a Reply

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