I want my distance variable to increase by 1 every time i click a / d.
import msvcrt
import time
import random
def Start():
input("Press ENTER to start")
print("On your marks...")
time.sleep(random.uniform(2, 5))
print("Set...")
time.sleep(random.uniform(0.5, 2))
print("GO!")
Distance = 100
Race(Distance)
def Race(Distance):
Travelled = 0
while Travelled != Distance:
Move1 = msvcrt.getwch()
if Move1 == chr(97):
Move2 = msvcrt.getwch()
if Move2 == chr(100):
Distance = Distance + 1
print(Distance)
Start()
