diff options
author | Mateu Batle <mateu.batle@collabora.co.uk> | 2010-10-27 17:40:28 (GMT) |
---|---|---|
committer | Mateu Batle <mateu.batle@collabora.co.uk> | 2010-10-27 17:40:28 (GMT) |
commit | 0018a9e211ebbe74d371339a70edc0d36c4fc99f (patch) | |
tree | ddfd93d0713c615ed70dbf869747b55b94791af8 /game1/newhighscore.py |
Initial import of game1 and game2 in math quwy
Diffstat (limited to 'game1/newhighscore.py')
-rwxr-xr-x | game1/newhighscore.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/game1/newhighscore.py b/game1/newhighscore.py new file mode 100755 index 0000000..25eeeca --- /dev/null +++ b/game1/newhighscore.py @@ -0,0 +1,36 @@ +import pygame, highScores,pares,impares,logging,os +from highScores import * +from pygame.locals import * +h = HighScore() + +class newhighscore(): + + + def __init__(self): + newScore = 0 + global item + item = h.loadscores() + global scorew + scorew = [] + i=0 + for i in range(len(item)): + scorew.append(item[i][0]) + print scorew + def main(self,newscore): + newenter = False + for score in scorew[:len(item)]: + if score < newscore : + newenter = True + if newenter == True: + item.append((newscore,os.getlogin())) + h.savescores(item) + else: + print "nooooo" + + LOG_FILENAME='Esquiador.log' + + log = logging.getLogger( 'EsquiadorRun' ) + #log.setLevel( logging.DEBUG ) + if __name__=="__main__": + logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG) + main() |