In the next part, collision detection with the spikes is added using line collision instead of physics.

Article by Richard Davey. Posted on 25th Jan 2019.   @photonstorm


From Emanuele Feronato: "Time to update the Phaser version adding collision detection. Yesterday in the Unity version of the prototype I wrote a script which forgives a lot of player errors, actually checking for collisions between the player and a single point of each spike.

Phaser version will be harder, because I will be checking shape collision between the player and the spikes.

How can we check for shape collision without physics? There won’t be any “shape” collision, we are going to check for line segment Vs circle like I did in this example.

There are only two sides of each triangle which can collide with the circle, and I am showing you when to check for collision by painting them red in this prototype:"

Read More