HTML5 prototype of mobile hit “Flipping Legend” with top down view made with Phaser – adding holes

Welcome to the second step of the Flipping Legend HTML5 prototype.

We are going to add deadly obstacles in front of our hero: holes.

It’s quite simple: you walk over a hole, you die and the game restarts.

Click or tap on the left/right half of the canvas to move the hero accordingly. If you have a mobile device, play it directly from this link.

Holes are sprites, but just like in every tile based game, we aren’t checking for collision but looking at the value of the array item the hero is walking on. I used object pooling to prevent the creation of unnecessary sprites.

To have more information about object pooling, read this post. There’s a cool game too.

Now, let me show you the completely commented source code:

Next time I’ll add enemies, coins and energy, meanwhile download the source code.

  • Guest

    Hi, please can you show how to implement those ads in Phaser game?

    http://gamedistribution.com/developers/

    There is an HTML5 example, but for some reason it does not work for me.
    It looks like a good option to me, I would like to try at least.