A short but useful tutorial on handling circle to line segment intersection in your games.

Article by Richard Davey. Posted on 26th Oct 2018.   @photonstorm

image

Emanuele Feronato has written this tutorial for circle to line segment intersection detection: "As a part in a bigger project – which you will hear about soon – I needed to find a quick way to check for collisions between a line segment and a circle.

It’s quite an easy task, but man, I found a lot of really weird ways to do it, so here’s my take ..."

This is handy for Phaser 2, but if you're using Phaser 3 then we provide the built-in Phaser.Geom.Intersects.LineToCircle function for you.

Read More