diff options
author | Mateu Batle <mateu.batle@collabora.co.uk> | 2010-09-13 16:48:24 (GMT) |
---|---|---|
committer | Mateu Batle <mateu.batle@collabora.co.uk> | 2010-09-13 16:48:24 (GMT) |
commit | ab3cdfc2d54445196106a7c9f2c052bd53a3e694 (patch) | |
tree | 431c21d1973e52dc4ba5f71b975f0a0c5f8d3e73 | |
parent | 46983562938a773a48d446eb068d3ce4d93d4ec6 (diff) | |
parent | 6bd19351a4ebba1bd0253805aef45836cf108edd (diff) |
Merge branch 'master' of git.sugarlabs.org:damxo-ski-on-numbers/mainline
Fixed conflicts
Conflicts:
finishGame.py
runEsquiadorFunc.py
-rwxr-xr-x | finishGame.py | 20 | ||||
-rwxr-xr-x | highScores.py | 3 | ||||
-rwxr-xr-x | impares.py | 3 | ||||
-rw-r--r-- | newhighscore.py | 36 | ||||
-rwxr-xr-x | pares.py | 3 | ||||
-rw-r--r-- | po/Esquiador.en.po | 156 | ||||
-rw-r--r-- | po/Esquiador.es.po | 158 | ||||
-rw-r--r-- | po/Esquiador.pot | 118 | ||||
-rw-r--r-- | po/POTFILES.in | 18 | ||||
-rwxr-xr-x | runEsquiadorFunc.py | 128 | ||||
-rwxr-xr-x | score.dat | 9 |
11 files changed, 576 insertions, 76 deletions
diff --git a/finishGame.py b/finishGame.py index 8ff5035..9e157f1 100755 --- a/finishGame.py +++ b/finishGame.py @@ -1,21 +1,31 @@ #!/usr/bin/env python #-*- coding:utf-8 -*- -import pygame,sys +import pygame,sys,impares,pares import txtlib from pygame.locals import * from constants import * from gettext import gettext as _ +from pares import * +from impares import * -def finishing(): +def finishing(score,mod): pygame.init() screen = pygame.display.set_mode(screen_size) - + m="" + if mod =="pares": + m = "pares" + + else: + m = "impares" + + + text = txtlib.Text((screen_size[0]-200,screen_size[1]-200), 'freesans') text.text = _('''Actividad Esquiador terminada! - \nModalidad: - \nPuntaje: + \nModalidad: \t'''+m+''' + \nPuntaje:\t'''+str(score)+''' \nFelicitaciones ! ! ! ! ! \nEste juego permite diferenciar entre los diferentes tipos de numeros. \nGracias por jugarlo, y buena suerte! diff --git a/highScores.py b/highScores.py index f40d537..7f5f197 100755 --- a/highScores.py +++ b/highScores.py @@ -17,7 +17,6 @@ class HighScore(): temp = line.split('\t') items.append((int(temp[1].strip()), (temp[0]))) file.close() - return items def numeric_compare(self, x, y): @@ -53,7 +52,7 @@ class HighScore(): if newstuffs < 65: newstuffs = 90 return chr(newstuffs) - + def __init__(self): self.thefont = pygame.font.Font(os.path.join('fonts', 'ice_sticks.ttf'), 18) self.titlefont = pygame.font.Font(os.path.join('fonts', 'ice_sticks.ttf'), 35) @@ -12,7 +12,7 @@ from score import * from constants import * LOG_FILENAME='Esquiador.log' - +skier = None log = logging.getLogger( 'EsquiadorRun' ) #log.setLevel( logging.DEBUG ) @@ -26,6 +26,7 @@ def mainImpares(): if olpcgames.ACTIVITY: size = olpcgames.ACTIVITY.game_size screen = pygame.display.set_mode(size) + global skier skier = Skier('impares') track = Track() score = Score(skier) diff --git a/newhighscore.py b/newhighscore.py new file mode 100644 index 0000000..25eeeca --- /dev/null +++ b/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() @@ -12,7 +12,7 @@ from score import * from constants import * LOG_FILENAME='Esquiador.log' - +skier = None log = logging.getLogger( 'EsquiadorRun' ) #log.setLevel( logging.DEBUG ) @@ -26,6 +26,7 @@ def mainPares(): if olpcgames.ACTIVITY: size = olpcgames.ACTIVITY.game_size screen = pygame.display.set_mode(size) + global skier skier = Skier('pares') track = Track() score = Score(skier) diff --git a/po/Esquiador.en.po b/po/Esquiador.en.po new file mode 100644 index 0000000..c496366 --- /dev/null +++ b/po/Esquiador.en.po @@ -0,0 +1,156 @@ +# English translations for PACKAGE package. +# Copyright (C) 2010 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Mateu Batle <mbatle@gmail.com>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-09-08 13:23-0500\n" +"PO-Revision-Date: 2010-09-08 13:25-0500\n" +"Last-Translator: Mateu Batle <mbatle@gmail.com>\n" +"Language-Team: English\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: activity/activity.info:2 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/activity.py:8 +msgid "Esquiador" +msgstr "Ski On Numbers" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/about.py:17 +msgid "" +"Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares\n" +"\t\n" +"Autores:\n" +"\tMateu Batle\n" +"\tRicardo Flores \n" +"\tEduardo Rodriguez\n" +"\t\n" +"Juego desarrollado en Python, Pygame y \n" +"\talgunas librerias de terceros." +msgstr "" +"Ski on Numbers\n" +"\t\n" +"Math game to learn even and odd numbers\n" +"\t\n" +"Authors:\n" +"\tMateu Batle\n" +"\tRicardo Flores \n" +"\tEduardo Rodriguez\n" +"\t\n" +"Game developed in python, pygame and y \n" +"\tsome third party libraries." + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/score.py:21 +#, python-format +msgid "PUNTAJE: %05d" +msgstr "SCORE: %05d" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/highScores.py:72 +msgid "" +"Esquiador\n" +"Puntajes mas altos:\n" +msgstr "" +"Ski On Numbers\n" +"High Scores:\n" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/finishGame.py:16 +msgid "" +"Actividad Esquiador terminada!\n" +"\t\n" +"Modalidad: \n" +"\t\n" +"Puntaje:\n" +"\t\n" +"Felicitaciones ! ! ! ! ! \n" +"\t\n" +"Este juego permite diferenciar entre los diferentes tipos de numeros.\n" +"\t\n" +"Gracias por jugarlo, y buena suerte!\n" +"\t" +msgstr "" +"Activity Ski on Numbers completed !\n" +"\t\n" +"Mode: \n" +"\t\n" +"Score:\n" +"\t\n" +"Congratulations ! ! ! ! ! \n" +"\t\n" +"This game allows to learn odd and even numbers.\n" +"\t\n" +"Thanks for playing and good luck !\n" +"\t" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/help.py:17 +msgid "" +"Ayuda de Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares.\n" +"\t\n" +" Debes ayudar al esquiador a pasar por las \n" +"\tbanderas pares o impares, dependiendo del juego.\n" +"\tPuedes desplazarte por todo el circuito,\n" +"\tmoverte a la izquierda o a la derecha\n" +"\tavanzar o detenerte lo suficiente para\n" +"\tesquivar obstaculos o para pasar por las banderas\n" +"\tcon puntaje.\n" +"\tTen cuidado con chocar con otros elementos\n" +"\tpues tu puntaje disminuira. Suerte!" +msgstr "" +"Ski On Numbers Help\n" +"\t\n" +"Math Game to learn odd and even numbers\n" +"\t\n" +" You must help the skier to go through the\n" +"\tflags with odd or even numbers depending on the game.\n" +"\tYou can move around all the track,\n" +"\tmove to the left or to the right,\n" +"\tgo forward or stop enough to\n" +"\tdodge obstacles and go over the flags\n" +"\tto increase your score.\n" +"\tBe careful to collide with other elements\n" +"\tsince your score will decrease. Good luck!" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:35 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:42 +msgid "Numeros pares" +msgstr "Even numbers" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:36 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:52 +msgid "Numeros impares" +msgstr "Odd numbers" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:37 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:62 +msgid "Puntajes mas altos" +msgstr "High Scores" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:38 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:68 +msgid "Ayuda" +msgstr "Help" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:39 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:74 +msgid "Acerca de" +msgstr "About" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:40 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:80 +msgid "Salir" +msgstr "Quit" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/olpcgames/canvas.py:151 +#, python-format +msgid "%s Source" +msgstr "%s Source" diff --git a/po/Esquiador.es.po b/po/Esquiador.es.po new file mode 100644 index 0000000..5d341e3 --- /dev/null +++ b/po/Esquiador.es.po @@ -0,0 +1,158 @@ +# English translations for PACKAGE package. +# Copyright (C) 2010 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Mateu Batle <mbatle@gmail.com>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-09-08 13:23-0500\n" +"PO-Revision-Date: 2010-09-08 14:30-0500\n" +"Last-Translator: Mateu Batle <mbatle@gmail.com>\n" +"Language-Team: English\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: activity/activity.info:2 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/activity.py:8 +msgid "Esquiador" +msgstr "Esquiador" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/about.py:17 +msgid "" +"Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares\n" +"\t\n" +"Autores:\n" +"\tMateu Batle\n" +"\tRicardo Flores \n" +"\tEduardo Rodriguez\n" +"\t\n" +"Juego desarrollado en Python, Pygame y \n" +"\talgunas librerias de terceros." +msgstr "" +"Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares\n" +"\t\n" +"Autores:\n" +"\tMateu Batle\n" +"\tRicardo Flores \n" +"\tEduardo Rodriguez\n" +"\t\n" +"Juego desarrollado en Python, Pygame y \n" +"\talgunas librerias de terceros." + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/score.py:21 +#, python-format +msgid "PUNTAJE: %05d" +msgstr "PUNTAJE: %05d" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/highScores.py:72 +msgid "" +"Esquiador\n" +"Puntajes mas altos:\n" +msgstr "" +"Esquiador\n" +"Puntajes mas altos:\n" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/finishGame.py:16 +msgid "" +"Actividad Esquiador terminada!\n" +"\t\n" +"Modalidad: \n" +"\t\n" +"Puntaje:\n" +"\t\n" +"Felicitaciones ! ! ! ! ! \n" +"\t\n" +"Este juego permite diferenciar entre los diferentes tipos de numeros.\n" +"\t\n" +"Gracias por jugarlo, y buena suerte!\n" +"\t" +msgstr "" +"Actividad Esquiador terminada!\n" +"\t\n" +"Modalidad: \n" +"\t\n" +"Puntaje:\n" +"\t\n" +"Felicitaciones ! ! ! ! ! \n" +"\t\n" +"Este juego permite diferenciar entre los diferentes tipos de numeros.\n" +"\t\n" +"Gracias por jugarlo, y buena suerte!\n" +"\t" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/help.py:17 +msgid "" +"Ayuda de Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares.\n" +"\t\n" +" Debes ayudar al esquiador a pasar por las \n" +"\tbanderas pares o impares, dependiendo del juego.\n" +"\tPuedes desplazarte por todo el circuito,\n" +"\tmoverte a la izquierda o a la derecha\n" +"\tavanzar o detenerte lo suficiente para\n" +"\tesquivar obstaculos o para pasar por las banderas\n" +"\tcon puntaje.\n" +"\tTen cuidado con chocar con otros elementos\n" +"\tpues tu puntaje disminuira. Suerte!" +msgstr "" +"Ayuda de Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares.\n" +"\t\n" +" Debes ayudar al esquiador a pasar por las \n" +"\tbanderas pares o impares, dependiendo del juego.\n" +"\tPuedes desplazarte por todo el circuito,\n" +"\tmoverte a la izquierda o a la derecha\n" +"\tavanzar o detenerte lo suficiente para\n" +"\tesquivar obstaculos o para pasar por las banderas\n" +"\tcon puntaje.\n" +"\tTen cuidado con chocar con otros elementos\n" +"\tpues tu puntaje disminuira. Suerte!" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:35 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:42 +msgid "Numeros pares" +msgstr "Numeros pares" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:36 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:52 +msgid "Numeros impares" +msgstr "Numeros impares" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:37 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:62 +msgid "Puntajes mas altos" +msgstr "Puntajes mas altos" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:38 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:68 +msgid "Ayuda" +msgstr "Ayuda" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:39 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:74 +msgid "Acerca de" +msgstr "Acerca de" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:40 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:80 +msgid "Salir" +msgstr "Salir" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/olpcgames/canvas.py:151 +#, python-format +msgid "%s Source" +msgstr "%s Source" diff --git a/po/Esquiador.pot b/po/Esquiador.pot new file mode 100644 index 0000000..519a570 --- /dev/null +++ b/po/Esquiador.pot @@ -0,0 +1,118 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-09-08 13:23-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: activity/activity.info:2 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/activity.py:8 +msgid "Esquiador" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/about.py:17 +msgid "" +"Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares\n" +"\t\n" +"Autores:\n" +"\tMateu Batle\n" +"\tRicardo Flores \n" +"\tEduardo Rodriguez\n" +"\t\n" +"Juego desarrollado en Python, Pygame y \n" +"\talgunas librerias de terceros." +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/score.py:21 +#, python-format +msgid "PUNTAJE: %05d" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/highScores.py:72 +msgid "" +"Esquiador\n" +"Puntajes mas altos:\n" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/finishGame.py:16 +msgid "" +"Actividad Esquiador terminada!\n" +"\t\n" +"Modalidad: \n" +"\t\n" +"Puntaje:\n" +"\t\n" +"Felicitaciones ! ! ! ! ! \n" +"\t\n" +"Este juego permite diferenciar entre los diferentes tipos de numeros.\n" +"\t\n" +"Gracias por jugarlo, y buena suerte!\n" +"\t" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/help.py:17 +msgid "" +"Ayuda de Esquiador\n" +"\t\n" +"Juego matematico para diferenciar\n" +"\tnumeros pares de impares.\n" +"\t\n" +" Debes ayudar al esquiador a pasar por las \n" +"\tbanderas pares o impares, dependiendo del juego.\n" +"\tPuedes desplazarte por todo el circuito,\n" +"\tmoverte a la izquierda o a la derecha\n" +"\tavanzar o detenerte lo suficiente para\n" +"\tesquivar obstaculos o para pasar por las banderas\n" +"\tcon puntaje.\n" +"\tTen cuidado con chocar con otros elementos\n" +"\tpues tu puntaje disminuira. Suerte!" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:35 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:42 +msgid "Numeros pares" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:36 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:52 +msgid "Numeros impares" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:37 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:62 +msgid "Puntajes mas altos" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:38 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:68 +msgid "Ayuda" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:39 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:74 +msgid "Acerca de" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:40 +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/runEsquiadorFunc.py:80 +msgid "Salir" +msgstr "" + +#: /home/mbatle/work/usmp/damxo/damxo-ski-on-numbers/olpcgames/canvas.py:151 +#, python-format +msgid "%s Source" +msgstr "" diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..1a0995d --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,18 @@ +encoding: UTF-8 +about.py +about.py +activity.py +constants.py +finishGame.py +help.py +highScores.py +impares.py +jmenu_light.py +jmenu.py +pares.py +runEsquiadorFunc.py +score.py +setup.py +skier.py +track.py +txtlib.py 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() @@ -1,4 +1,5 @@ -Mateu 10000 -Ricardo 9000 -Aldo 3000 -Eduardo 20000 +drako 27955 +drako 26520 +drako 25919 +EDUARDO 20000 +MATEU 10000 |