|
Lines 4-9
import pygame
Link Here
|
| 4 |
import math |
4 |
import math |
| 5 |
import sys |
5 |
import sys |
| 6 |
import config |
6 |
import config |
|
|
7 |
from os.path import expanduser, dirname |
| 8 |
from os import makedirs |
| 7 |
|
9 |
|
| 8 |
COLOR_CESTA = pygame.color.Color("yellow") |
10 |
COLOR_CESTA = pygame.color.Color("yellow") |
| 9 |
COLOR_TRAVA = pygame.color.Color("green") |
11 |
COLOR_TRAVA = pygame.color.Color("green") |
|
Lines 228-238
class Auto:
Link Here
|
| 228 |
self.winnerwav.play() |
230 |
self.winnerwav.play() |
| 229 |
config.konec = 1 |
231 |
config.konec = 1 |
| 230 |
if config.besttime > config.time: |
232 |
if config.besttime > config.time: |
| 231 |
readonly = open(config.trackFile) |
233 |
users_trackFile = expanduser("~/.wrw/") + config.trackFile |
|
|
234 |
try: |
| 235 |
readonly = open(users_trackFile) |
| 236 |
except: |
| 237 |
readonly = open(config.trackFile) |
| 232 |
content = readonly.readlines() |
238 |
content = readonly.readlines() |
| 233 |
readonly.close() |
239 |
readonly.close() |
| 234 |
|
240 |
|
| 235 |
score = open(config.trackFile ,"w") |
241 |
try: |
|
|
242 |
score = open(users_trackFile, "w") |
| 243 |
except IOError: |
| 244 |
makedirs(dirname(users_trackFile), 0700) |
| 245 |
score = open(users_trackFile, "w") |
| 246 |
|
| 236 |
score.write(str(config.time) + "\n") |
247 |
score.write(str(config.time) + "\n") |
| 237 |
score.write(config.name + "\n") |
248 |
score.write(config.name + "\n") |
| 238 |
score.write(config.car + "\n") |
249 |
score.write(config.car + "\n") |