I uploaded an example for you, pls check the game and code.
So, in my version car's direction depends of the map tile under the car.
Also I'm using only integer numbers instead floats to avoid number comparsion errors.
Pls try to understand and let me know.
Thanks