From e17aa04d91c7ca00dc6890ced6a4e1f5052f290f Mon Sep 17 00:00:00 2001 From: Sebas Date: Mon, 30 Jul 2012 23:38:13 +0000 Subject: Menu principal --- diff --git a/.project b/.project index e6b5df6..84d1b36 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - YoButia + aprendobot diff --git a/.pydevproject b/.pydevproject index 23a1332..51702f3 100644 --- a/.pydevproject +++ b/.pydevproject @@ -3,7 +3,7 @@ -/YoButia +/aprendobot python 2.7 Python diff --git a/YoButia.py b/YoButia.py index 2b2b57b..1ba4760 100644 --- a/YoButia.py +++ b/YoButia.py @@ -4,6 +4,7 @@ import os import imp from gettext import gettext as _ import time +import sys #constantes EVENTORESPUESTA = pygame.USEREVENT+1 @@ -14,6 +15,15 @@ CAMINORECURSOS = "recursos" CAMINOCOMUN = "comun" CAMINOIMAGENES = "imagenes" CAMINODATOS = "datos" +CAMINOFUENTES = "fuentes" + +clock = pygame.time.Clock() + +def wait_events(): + """ Funcion para esperar por eventos de pygame sin consumir CPU """ + global clock + clock.tick(20) + return pygame.event.get() class YoButia(): def __init__(self): @@ -32,11 +42,18 @@ class YoButia(): time.sleep(2) + #Main principal del juego + while 1: + self.pantallaInicial() + + + time.sleep(2) + def presentacion(self): self.pantalla.fill((0,0,0)) self.pantalla.blit(self.fondo1, (int(75*scale+shift_x),int(75*scale+shift_y))) - self.mostrarTexto(_("Press any key to skip"), + self.mostrarTexto(_("Presione una tecla para continuar"), self.fuente32, (int(600*scale+shift_x),int(800*scale+shift_y)), (255,155,155)) @@ -88,8 +105,24 @@ class YoButia(): # fondo presentacion self.fondo1 = self.cargarImagen("fondo1.png") - #Cargar fuentes + # cargar fuentes + self.fuente60 = pygame.font.Font(os.path.join(CAMINORECURSOS,\ + CAMINOCOMUN,\ + CAMINOFUENTES,\ + "Share-Regular.ttf"), + int(60*scale)) + self.fuente40 = pygame.font.Font(os.path.join(CAMINORECURSOS,\ + CAMINOCOMUN,\ + CAMINOFUENTES,\ + "Share-Regular.ttf"), + int(34*scale)) + self.fuente9 = pygame.font.Font(os.path.join(CAMINORECURSOS,\ + CAMINOCOMUN,\ + CAMINOFUENTES,\ + "Share-Regular.ttf"), + int(20*scale)) self.fuente32 = pygame.font.Font(None, int(30*scale)) + self.fuente24 = pygame.font.Font(None, int(24*scale)) def loadCommons(self): @@ -125,6 +158,32 @@ class YoButia(): int(imagen0.get_height()*scale))) del imagen0 return imagen + + def pantallaInicial(self): + """Pantalla con el menu principal del juego""" + global scale, shift_x, shift_y + self.pantalla.fill((0,0,0)) + self.mostrarTexto(unicode(_("MENU PRINCIPAL"), "UTF-8"), + self.fuente60, + (int(50*scale+shift_x), + int(50*scale+shift_y)), + (255,255,255)) + self.mostrarTexto(_("About this game"), + self.fuente40, + (int(300*scale+shift_x),int(825*scale+shift_y)), + (100,200,100)) + pygame.display.flip() + + while 1: + # Pump GTK messages. + while gtk.events_pending(): + gtk.main_iteration() + + for event in wait_events(): + if event.type == pygame.KEYDOWN: + if event.key == 27: # escape: volver + sys.exit() + return def main(): juego = YoButia() diff --git a/recursos/comun/datos/commons.py b/recursos/comun/datos/commons.py index 6f7718c..3fdeeb1 100644 --- a/recursos/comun/datos/commons.py +++ b/recursos/comun/datos/commons.py @@ -2,40 +2,8 @@ from gettext import gettext as _ -BEGIN = [ - _('Do you like to know about Robot? Lets start!') -] - -LEARNING = [ - _('Do you know about Robot?'), - _('Choose from images the once"s that shows Robots'), - _('Can you show me where are Robots?'), - _('Find the sensors in the images'), - _('Choose the actuators in the images'), - _('Which of these tasks can make a robot?') - ] -REWARDS = [ - _('Perfect, you are becoming an expert!'), - _('You have done very well! Continue like that'), - _('Well done!'), - _('Brilliant!') - ] -MISTAKES = [ - _('Try again, you can do it!'), - _('No, that is not correct. Try again!'), - _('No, it is not a Robot'), - _('No, it is not a sensor'), - _('No, it is not an actuator'), - ] -BYE = [ - _("Better luck next time\nI'll rest a while..."), - _("The next time will be better\nI'm going to play with my friends."), - _("Please try again") -] - ] -CREDITS = [ - _("Author: Rolo, Seba, Sil"), - _("Send corrections, comments or suggestions to: grupo-proyecto-butia-2012@googlegroups.com"), - "", - _("This program is free software developed by the community") - ] \ No newline at end of file +PREFIX = [ + _('We have to find'), + _('Now we have to find'), + _('We need to find') +] \ No newline at end of file diff --git a/recursos/comun/fuentes/Share-Regular.ttf b/recursos/comun/fuentes/Share-Regular.ttf new file mode 100644 index 0000000..dc9378f --- /dev/null +++ b/recursos/comun/fuentes/Share-Regular.ttf Binary files differ -- cgit v0.9.1