Warning: I apologize for making it quite computationally demanding, so if you'll run the project on a less powerful laptop, or on a tablet (notebook) or a phone, it is going to be maddeningly slow, so better run it on a (powerful) desktop computer.
a maze and a car image, designed by fridolinux in his autorennen 2.0 project,
nested to it are several stick-like sprites ('lasers' ) sensing how far from the car are the walls in various directions, which is achieved by percentually adjusting their individual sizes,
higher order functions, such as KEEP, MAP, and COMBINE are used to get lists of front lasers and back ones, their lengths, and the longest front laser's direction is then used to steer the car (or, when it is shorter than some value, the longest among the back laser's direction is used instead).
When the mouse-pointer is touching the car, the lasers are shown more visibly (i. e. with a lesser ghost effect).
Ideas to spice up the project:
I have been thinking about adding a small-range rotations to the individual lasers in order to find the best possible direction at each step, but that would make the simulation really slow, I guess.
If that was not the case, I would like to add maybe passengers or other cars that the self-driving car would have to avoid.
When I have tried running it on the community site (in "my projects", visible only to me), well, it was too slow. It seems that the embedding makes projects quite slower. Since it is already slow, I prefer it is not run in any embedded form, that is why I decided to not publish it.
Hopefully I am keeping my ability to ask beginners (and stupid) questions - it keeps one's mind open - as my little superpower.
Besides, I still don't understand bunch of things, so be prepared to be asked very stupid questions in the coming 2021; ha ha ha
What I wish in the new year is to ask Jens & Jadga if could I collaborate with them making a tutorial on how to re-create the "Self-driving Car Simulation" project with me in a puppet role, semi-randomly (impro comedy, few years ago I took some real "impro comedy" courses...) stupid (beginners) questions (kind of the 1970s old tv "Muppets Show"), some met by educational answers/tips where to find answers (by Jens/Jadga, or/and by you, Brian, if you are interested), while the more absurd ones being just dismissed with an annoyed (bored) Jens'/Jadga's/your face doing facepalm for comical effect, dissolving the learning curve stress in the process. Just an ordinary, humble, New Year wish by a superstar of stupidity, ha ha, but why not.
That sounds great! But meanwhile we can't put it in Featured Projects if you don't publish it. You could put in the project notes that people should click "view code" and run it in the editor instead of directly on the site.
Ummm sort of... In the new (7.0) version, the libraries work again, but you have to reload the dev version of the library. This is going to be a big pain in the neck for everyone, we know; we wish there were a way we could avoid it. So...