export function PointLineCollision ( x1 , y1 , x2 , y2 , px , py ) { let d1 = Phaser . Math . Distance . Between ( px , py , x1 , y1 ) ; let d2 = Phaser . Math . Distance . Between ( px , py , x2 , y2 ) ; let lineLen = Phaser . Math . Distance . Between ( x1 , y1 , x2 , y2 ) ; let buffer = 0.1 ; if ( d1 + d2 >= lineLen - buffer && d1 + d2 <= lineLen + buffer ) { return true ; } return false ; }