Create an HTML5 game like Space is Key with a lot of room for customization step 2: adding obstacles

This has been one of the most difficult post to write. I am currently on holiday and I have a really bad connection, anyway finally I managed to publish something, all in all I am a blogger and bloggers have to post!

Here we go with the second step of the HTML5 game like Space is Key with a lot of room for customization, this time we’ll be adding some random obstacles and manage collisions, covering groups and physics overlapping.

At this time, generated levels aren’t guaranteed to be solvable, this will involve some artificial intelligence to create levels according to game parameters such as jump speed, but I am definitively willing to do it, meanwhile here is what you have at the moment:

Click the mouse to make blue box jump, avoid obstacles.

And here is the commented source code, with new lines highlighted, created with Phaser Framework:

You can also download the source code with all required libraries

  • Garrett

    Nice. Good job, might look into HTML programming. Hey, I would love if you made an AS3 platforming tutorial with water, movable objects, ect. That would be your best tutorial ever. Cheers, and love your website!