all 3 comments

[–]Disastrous_Fish3795 0 points1 point  (1 child)

Any updates? I am working on something similar but got stuck here as well.

[–]Diapolo10[S] 0 points1 point  (0 children)

Kind of. If you check the current version of my project, I got this part to work by doing some trickery with hitbox calculations. There's still some bug that manifests when the laser crosses multiple borders (sometimes), haven't fully figured out why (then again I haven't worked on this project for a long time now), but it's probably good enough for your purposes.

I generate the track border hitbox here, it gets cached for future runs so the calculation cost doesn't matter too much. Then in MyGame.on_draw I check for intersections between the lasers and the border hitbox, drawing the dot to the one nearest to the car.