Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/runEsquiadorFunc.py
diff options
context:
space:
mode:
Diffstat (limited to 'runEsquiadorFunc.py')
-rwxr-xr-xrunEsquiadorFunc.py128
1 files changed, 65 insertions, 63 deletions
diff --git a/runEsquiadorFunc.py b/runEsquiadorFunc.py
index f3a1009..df2f163 100755
--- a/runEsquiadorFunc.py
+++ b/runEsquiadorFunc.py
@@ -1,82 +1,84 @@
-import pygame, jmenu, impares, pares, olpcgames, logging, finishGame, sys, about, help, highScores
+import pygame, jmenu, impares, pares, olpcgames, logging, finishGame, sys, about, help, highScores, newhighscore
from impares import *
from pares import *
from constants import *
from finishGame import *
from about import *
from help import *
+from newhighscore import *
from highScores import *
from constants import *
from gettext import gettext as _
-LOG_FILENAME='Esquiador.log'
-
-log = logging.getLogger( 'EsquiadorRun' )
-#log.setLevel( logging.DEBUG )
highScore = HighScore()
-
-screen = pygame.display.set_mode(screen_size)
-bg = imagenFondo;
-
-
-pygame.display.flip()
-color = (0,0,0)
-font = './fonts/ice_sticks.ttf'
-just = True
-pos = ('center','center')
+nh = newhighscore()
def estadoJugador(self, estado):
self.jugador=estado
-while pygame.event.poll().type != pygame.QUIT:
- screen.blit(bg, (0,0) )
+def main():
+ LOG_FILENAME='Esquiador.log'
+ log = logging.getLogger( 'EsquiadorRun' )
+ #log.setLevel( logging.DEBUG )
- selection = jmenu.run([
- _('Numeros pares'),
- _('Numeros impares'),
- _('Puntajes mas altos') ,
- _('Ayuda'),
- _('Acerca de'),
- _('Salir')],
- color,42,font=font,light=10,justify=just,pos=pos)
- if selection == _('Numeros pares'):
- just = True
- pos = ('center','center')
- color = (0,0,0)
- font = font
- try:
- pares.mainPares()
- except IndexError:
- print 'Termino el juego de pares!!!'
- finishGame.finishing()
- elif selection == _('Numeros impares'):
- just = True
- pos = ('center','center')
- color = (0,0,0)
- font = font
- try:
- impares.mainImpares()
- except IndexError:
- print 'Termino el juego de impares!!!'
- finishGame.finishing()
- elif selection == _('Puntajes mas altos'):
- just = True
- pos = ('center','center')
- color = (0,0,0)
- font = font
- highScore.mainHighScores()
- elif selection == _('Ayuda'):
- just = True
- pos = ('center','center')
+ screen = pygame.display.set_mode(screen_size)
+ bg = imagenFondo;
+
+
+ pygame.display.flip()
color = (0,0,0)
- font = font
- help.mainHelp()
- elif selection == _('Acerca de'):
+ font = './fonts/ice_sticks.ttf'
just = True
pos = ('center','center')
- color = (0,0,0)
- font = font
- about.mainAbout()
- elif selection == _('Salir') :
- sys.exit(0)
- #break
+
+ while pygame.event.poll().type != pygame.QUIT:
+ screen.blit(bg, (0,0) )
+ selection = jmenu.run([_('Numeros pares'),_('Numeros impares'),_('Puntajes mas altos') ,_('Ayuda'),_('Acerca de'),_('Salir')],color,42,font=font,light=10,justify=just,pos=pos)
+ if selection == _('Numeros pares'):
+ just = True
+ pos = ('center','center')
+ color = (0,0,0)
+ font = font
+ try:
+ pares.mainPares()
+ except IndexError:
+ print 'Termino el juego de pares!!!'
+ global skier
+ nh.main(pares.skier.score)
+ finishGame.finishing(pares.skier.score,"pares")
+ elif selection == _('Numeros impares'):
+ just = True
+ pos = ('center','center')
+ color = (0,0,0)
+ font = font
+ try:
+ impares.mainImpares()
+ except IndexError:
+ print 'Termino el juego de impares!!!'
+ global skier
+ nh.main(impares.skier.score)
+ finishGame.finishing(impares.skier.score,"impares")
+ elif selection == _('Puntajes mas altos')j:
+ just = True
+ pos = ('center','center')
+ color = (0,0,0)
+ font = font
+ highScore.mainHighScores()
+ elif selection == _('Ayuda'):
+ just = True
+ pos = ('center','center')
+ color = (0,0,0)
+ font = font
+ help.mainHelp()
+ elif selection == ('Acerca de'):
+ just = True
+ pos = ('center','center')
+ color = (0,0,0)
+ font = font
+ about.mainAbout()
+ elif selection == _('Salir') :
+ sys.exit(0)
+ #break
+if __name__=="__main__":
+ logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
+ main()