Dux02 / AM2050

Project am2050a
0 stars 0 forks source link

Cars crash when dt high #2

Closed Blasylf closed 11 months ago

Blasylf commented 11 months ago

Problem: see title. Not exactly sure what is causing it - initially I thought it had to do with:

See picture: image

Paradoxically, in this case, infront = None! A car must've crashed somehow even though there is no car in front of it. I suspect cars 'overtake' before they check for crashes!

Blasylf commented 11 months ago

I think I fixed this, frustratingly, by swapping the order of operations. Instead of updating speed, then acceleration, acceleration is updated first.