Game Development Community

Car physics...

by Ryan McKenzie · in Torque Game Builder · 01/16/2007 (11:23 am) · 2 replies

I am currently following the car physics mini tutorial at TDN. The tutorial is great.....but for my own game, i'll be changing some code and variables for the car control, so I'v tested the original settings and everything seems to be easily placed for changing the handling of the car. Though I can't locate what variables I should be changing to affect the top speed or the power of the brakes.

That I may eventually figure out but what I really struggle to find is how can I edit the code to change the force of accelaration and Decelaration?

Here's the code for the car.
http://tdn.garagegames.com/wiki/TGB/MiniTutorials/SimpleCarPhysics

#1
01/16/2007 (5:51 pm)
I believe the top speed is called something like cTrac. The accel and decel rate is handled by the rate of change of the throttle and brake. Look for where they're adding/subtracting numbers like throttle += 0.005. Higher number means faster acceleration.

#2
01/17/2007 (1:37 am)
Ben, Thank you so much. I eventually did figure out how to handle the speed and brakes but the accel and decel were keeping me up all night.