i am working on a car racing game and want to know what script should i use to calculate acceleration of the players car.
In im script im using an if/else statement:
if (my.car_speed < (my.max_speed * time))
{
my.car_speed += 1 * time; // increase the speed of the car
}
else //
{
my.car_speed -= 0.5 * time; // decrease the speed of the car
}
i have Max_speed defined as skill23 and car_speed defined as skill27. but i keep getting a syntrex error. can anyone help or give me a better script to use.
thanks alot
-Marc