Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/runEsquiadorFunc.py
blob: df2f163eb64a4941e6bb47fcc1084046c3fb8ac3 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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 _

highScore = HighScore()
nh = newhighscore()

def estadoJugador(self, estado):
	self.jugador=estado

def main():
	LOG_FILENAME='Esquiador.log'
	log = logging.getLogger( 'EsquiadorRun' )
	#log.setLevel( logging.DEBUG )

	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')

	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()