Another long title for another update to the HTML5 circular endless runner prototype built with Phaser. I wanted to build a physics game without using physics and I am doing it quite well. I already developed gravity, jump, double jump and collision detection using only mathematics and trigonometry, and today I have a couple of new features: * You are not longer limited to jump and double jump, you can adjust the game to let the player make any number of consecutive jumps just by changing a variable. * There is a fog effect – which is actually a circular gradient fading to black to totally transparent black color – which makes the spikes appear and disappear giving the idea of an endless environment. But they are just 9 sprites placed here and there according to player position. Have a look at the prototype: Click or tap to jump and double jump, or even to make a triple jump and see how spikes smoothly appear and disappear. What about the source code? I commented it line by line. There is still some – or better a lot of – room for improvement but having a source code with all comments will allow you to better understand how I built this prototype and above all to port the game in other languages, since I did not use any physics engine, just mathematics.
Now it’s time to add some kind of score and increase somehow the difficulty as you progress in the game, will do it next week, meanwhile download the source code.