I’m currently learning python, so I thought I’d make a racing game as my learning project. I have to properties assigned, forward movement speed and acceleration, and I’d like to write my script in a way that tells the bge to start with an initial speed of whatever I set the script to be (0.05 at this point) and accelerate every frame by the acceleration rate defined by the acceleration property. I tried this:
if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.UPARROWKEY]:
player.applyMovement((0, forSpd+forAccel, 0), True)
But all it does is add up the two speeds, making the vehicle move at a steady pace. How could I work this out? I don’t know if “applyForce” would be the ideal solution, because that wouldn’t be a steady acceleration as I would like it, and I don’t want the vehicle to speed out of control.
Thanks in advance!