Where SPEED is a constant and self.angle a int representing the orientation. I don't know if this is the best way because, the car speed depends of his orientation. Increasing the self.angle value will increase the components, this is not suitable for a car game i think.
I have another problem with the car movement. Each time the orientation change, i would like to rotate the car in the right direction. I thought to do something like that :
a_rad = math.asin(speedx/SPEED)
a_deg = math.degrees(a_rad)
self.sprite = pygame.transform.rotate(self.original, a_deg * -1)
self.rect = self.sprite.get_rect(center = self.rect.center)
It does not work properly, this way, my car can't rotate over 90° because of the speedx values.
Here is my code :
http://pastebin.com/VJgQRtYq
and the sprite i use for the car is joined.
Thanks for reading me.