HTML5 Down The Mountain game prototype made with Phaser: actually going down the mountain

Welcome to another step in the Down the Mountain series. After a brief intro about the hexagonal concept behind the game and some basic player movement now it’s time to show you how to actually go down the mountain, with the mountain scrolling like in the original game.

I made a lot of optimization to the code, and while there’s still space for even more optimization, now the player can go down the mountain with LEFT and RIGHT arrow keys, watching the mountain scrolling and having the endless runner feeling.

Have a look at it:

Run down the mountain with LEFT and RIGHT arrow keys, see how the mountain scrolls and how higher mountain blocks are removed from the game. Also, I don’t let the player move down the canvas too much, in this case I just increase scrolling speed.

Last time I post uncommented code about this prototype, next update I will show you the final code with all comments.

If you have doubts about some lines of the code, leave a comment. You can also download the source code of the entire prototype.

  • torhek

    Excelent example, thanks for share it! :D