Journal 14

fatalrun2600screenThis is a very simple code for a basic racing game I haven’t tested it out on my computer so I’m not sure it will work properly but if anything this will be a good starting point. I used two different modules time and msvcrt which I believe detects key presses for simple text based games.

import msvcrt
import time
high_score = 0
name = “Car Driver”
while True: distance = int(0)

print(‘Welcome to the race track. tap b to move.’)
print(‘n/Press enter to begin.)
k1 = msvcrt.getch().decode (ASCII’)
k1 = ‘z’:

distance += 1

if distance == 100
print (” You finished the race.”)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s