Create a HTML5 game like Space is Key using Phaser, tweens and ARCADE physics – step 2: adding spikes

If you enjoyed last week’s update to Space is Key series adding Phaser 2.6.2 version in the post Create a HTML5 game like Space is Key using Phaser, tweens and ARCADE physics you will like this update as I am showing you how to create levels adding deadly obstacles.

Let’s see what we are going to create:

Click or touch the canvas to make the player jump, don’t hit an obstacle or you will have to restart from scratch.

I am showing you the full source code, with each line commented for you to understand it, and with new lines highlighted, so you will find easy to see what I added to the original prototype.

With just a few lines we added deadly obstacles and level design, next time we’ll see how to add particle effects and more levels, meanwhile download the source code.