Click the Stage to select the track. Click the red ball to start the search. NOTE: It's advised to use Turbo Mode for a quicker presentation! (i.e: Press Shift + Click the Green Flag or See Inside, then in the header menu, press Edit > Turn on Turbo Mode)
Hello there! This project is the 2nd version of my Raceline Finder projects. TurboWarp: https://turbowarp.org/418920660?turbo 1st version: https://scratch.mit.edu/projects/167912019 This version ended up way more robust than the previous one. The whole script was completely remade from scratch. The previous version lacked a way to parameterize the car's behavior, for this reason, I've included new properties to define the speed, acceleration, and turning, as well as detecting the direction it is heading at a given point of the analysis. Now instead of trying to find the path with the shortest number of segments, it evaluates the cost for each segment (the number of frames the car is supposed to take while traveling the segment) and traces back the path with the smallest sum of costs possible! Different from the previous version, this one also detects collisions in-between two-point segments. I still pretend to explain the code, there is some math related to the heuristic function and data structure that is unclear and illegible, therefore I want to explain it, maybe leaving some comments in the code! Feel free to use the script in your projects, and to See Inside and draw any circuit you like, in the Stage section! Just make sure you use the same pattern (that can be found in the other circuits) to separate the starting position (blue dot) from the finish position (orange dot), with the lighter grey separator, just reminding that you must use the same colors. Also, feel free to comment and to suggest any improvements you would like to see in the project, I hope you like it! PS: If you're interested in this kind of projects, you might want to checkout matfin's contest as well: https://scratch.mit.edu/projects/475045 Also, feel free to check out my entry for that contest: