Game Development Community

Acceleration.....

by Ryan McKenzie · in Torque Game Builder · 01/27/2007 (10:51 am) · 4 replies

I have taken note and studied the script coding for the carPhysics minitutorial at TDN. I am making a similar game, but I am wanting to create 3 variables to create an acceleration. These variables would be:

1)A minimum speed
2)A maximum speed...
3)The time taken to reach from, minimum speed, to, maximum speed.

The deceleration will work in the same but opposite way. Except the car will very gently slow down, so therefor, there would be a very long time interval between maximum to minimum.

Could anyone help me in the subject on how to achieve this? The carPhysics tutorial has a very diffrent approach to accelaration.

#2
02/01/2007 (7:41 am)
The rate of acceleration and deceleration in that snippet is controlled by the very first if block in the onTimer method (where it says "// Throttle:"). You should be able to change the numbers there to get the effect you're talking about.

Is there something specifically different that you wanted to do with acceleration?
#3
02/01/2007 (2:52 pm)
What I was trying to figure out was how to have an acceleration different from a deceleration. Where as in the carPhysics tutorial, the cars acceleration is exactly the same as the deceleration. I'm not sure how to alter this.
#4
02/01/2007 (4:28 pm)
In the tutorial you're talking about deceleration is completely separate from acceleration and happens at a different rate. Take a look at the section of code I mentioned above.