Logic of a Game Racing

I’m trying to increase the speed of my car,
while I’m holding the key, so I want which speed will increasing
someone can help me?

Download The Blend:

The easiest way would be this:

KEYBOARD sensor > AND > MOTION (set object to dynamic/ rigid body) with a suitable forward force. As long as you hold the key down the speed should increase.

this logic dont serve for me,
i wanna make somthing in python,

This will work

import bge
from bge import logic
from bge import events
controller = logic.getCurrentController()
owner = controller.owner
key = logic.keyboard.events
force = 10
if key[bge.events.WKEY]==2:

attach this to your basic cube with an always True Pulse. Set the cube to dynamic or rigid body under the physics tab. Put a plane under your cube for the ground, leave the plane static.

or heres a blend.
force.blend (327 KB)

(set the object to dynamic to travel forwards, or to rigid body to roll forward)

very thanks man,

tnx for the code man,…ive got this, but how do i make a gear system for this,…or a manual transmission?