New answers tagged racing
I think the easiest way is to split track in sections and measure the time in each section as performance indicator. (That they do in real racing events) As stated here what you're asking is not an "exact science". A very hard way may be developing some sort of genetic algoritm or neural network , develop an AI that try to run the track minimizing the ...
The problem your having is that motion in games, as smooth as it might look, is better seen as a series of short teleportations. So, since distance is an unsigned value (always greater than zero), your car is just teleporting right past the absolute distance of zero. That causes the check to never go off. You have 3 options: You can add a margin of error ...
You're currently checking if i.y == 0 and only creating the new road section if this is true. If you accelerate and the roads stop lining up perfectly with the bounds of the world, this statement will never be true because the y value will jump from positive to negative without hitting exactly zero. Try i.y<=0; this way, even if the road stops lining up ...
Top 50 recent answers are included