Help for the car script
Posted: Thu Mar 27, 2008 8:27 pm
I want when I accelerate my car the wheels to start spinning.my car has the animation,but I don't know how to add it in the script
I need to add the command here right?
I have this at the beginning:
I think I must add this:
But I don't know how to add it and where. PLEASE I NEED YOUR KIND HELP (I would also be happy if there is a better car script,but that's another question
)
Code: Select all
RunCar[()
{
// Main Routine.
// Acceleration
// Check if key 15 is being pressed. Key 15 is, S
if(IsKeyDown(15))
{
// Key is Pressed. Increase the vehicle speed.
SPEED=SPEED+ACCELRATE;
if(tOFF > 90)
{
SPEED=0;
tOFF=0;
}
// Limit Speed to Max Speed
if(SPEED > MAXSPEED)
{
SPEED=MAXSPEED;
}
}
// Brakeing
// Check if key 27 is being pressed. Key 27 is, X
if(IsKeyDown(27))
{
// Vehicle is braking, slow down.
SPEED=SPEED-BRAKERATE;
if(SPEED < 0)
{
SPEED=0;
}
}
I have this at the beginning:
Code: Select all
ANIMATION [spin] // Accelerate Animation
Code: Select all
PlayAnimation(ANIMATION)
