F1 game acceleration

CLV25CLV25 Member Posts: 36
edited November -1 in Working with GS (Mac)
Hi,
I am currently working on a car game, which is similar to an f1 style game.
I am having trouble with the acceleration of the car though.
If I use accelerate I cannot find an appropriate way to stop the car.
If I use move it only has one speed.
I am trying to make it as realistic as possible, what movement method should I use?

Comments

  • POMPOM Member Posts: 2,599
    I would NOT use interpolate to stop the car , cause if you want to accelerate again the interpolate will override the acceleration rule ,
    instead i suggest :
    say you have an "accelerate" button , so when touch is pressed -> accelerate .
    in the Otherwise section give it 2 constrains:
    1) constrain "self.motion.linearvelocity.X" to self.motion.linearvelocity.X * 0.95
    2) constrain "self.motion.linearvelocity.Y" to self.motion.linearvelocity.Y * 0.95
    (You can change the 0.95 to adjust the "speed" of the slowdown)

    This way when the player is not accelerating the car will slow down and when the player hits accelerate the car will accelerate in the proper way.

    Roy.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah like pom said dont use interpolate to slow the car down

    Heres another way to do it:

    by adding dragv(its a self phyics attribute) to the car actor that will slow it down when the cars not acclerating. YOu can play around with that till its how you like. And have your accelerate rule relative to actor, then for you left and right buttons just rotate the actor clockwise and counterclockwise

    that should do it for ya
  • LumpAppsLumpApps Member Posts: 2,881
    Move is a way to override al forms of Uhm, movement. I have a car example published.
Sign In or Register to comment.