Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/newhighscore.py
blob: 25eeeca289827cf94a74f6450d157db56fbdd4bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()