From 1c73155fbbc0825c561350238cb91a1a3d864451 Mon Sep 17 00:00:00 2001 From: Alan Aguiar Date: Sat, 21 Jan 2012 02:56:20 +0000 Subject: version 2 --- diff --git a/MANIFEST b/MANIFEST index 6470cc3..5bc0764 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,42 +1,40 @@ -conozcoal.py -run.py -activity.py setup.py NEWS COPYING -activity/conozco-alimentos.svg -activity/activity.info -olpcgames/COPYING +conozcoal.py +activity.py +recursos/lamina/zonas.txt +recursos/lamina/zonas.png +recursos/lamina/niveles.txt +recursos/lamina/LICENSE +recursos/lamina/lamina.png +recursos/comun/sonidos/junggle_btn045.wav +recursos/comun/imagenes/terron.png +recursos/comun/imagenes/LICENSE +recursos/comun/imagenes/globito.png +recursos/comun/imagenes/bicho.png +recursos/comun/fuentes/Share-Regular.ttf +recursos/comun/datos/creditos.txt +olpcgames/__init__.py +olpcgames/_version.py +olpcgames/_gtkmain.py olpcgames/_cairoimage.py -olpcgames/svgsprite.py +olpcgames/video.py olpcgames/util.py -olpcgames/__init__.py +olpcgames/textsprite.py +olpcgames/svgsprite.py +olpcgames/pausescreen.py olpcgames/pangofont.py -olpcgames/_gtkmain.py -olpcgames/canvas.py +olpcgames/mesh.py olpcgames/gtkEvent.py -olpcgames/_version.py -olpcgames/video.py olpcgames/eventwrap.py +olpcgames/dbusproxy.py +olpcgames/COPYING +olpcgames/canvas.py olpcgames/camera.py -olpcgames/mesh.py -olpcgames/pausescreen.py -olpcgames/activity.py -olpcgames/textsprite.py olpcgames/buildmanifest.py -olpcgames/dbusproxy.py +olpcgames/activity.py olpcgames/data/__init__.py olpcgames/data/sleeping_svg.py -recursos/comun/datos/creditos.txt -recursos/comun/fuentes/AllCaps.ttf -recursos/comun/fuentes/Share-Regular.ttf -recursos/comun/imagenes/globito.png -recursos/comun/imagenes/bicho.png -recursos/comun/imagenes/terron.png -recursos/comun/imagenes/LICENSE -recursos/comun/sonidos/junggle_btn045.wav -recursos/lamina/niveles.txt -recursos/lamina/zonas.txt -recursos/lamina/zonas.png -recursos/lamina/lamina.png -recursos/lamina/LICENSE +activity/conozco-alimentos.svg +activity/activity.info diff --git a/NEWS b/NEWS index 2f92850..efdd378 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ -2010-08-11 +2012-01-15 -Primera versión de Conozco Alimentos +Segunda versión. +Se corrigen detalles. +Se agrega compatibilidad con Sugar 0.90 o posterior. +Se modifica icono con estilo Sugar. + +2010-08-11 + +Primera versión de Conozco Alimentos. diff --git a/activity.py b/activity.py index 1bc88e8..1bc88e8 100644..100755 --- a/activity.py +++ b/activity.py diff --git a/activity/activity.info b/activity/activity.info index f0d79fe..ae77d1b 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,8 +1,7 @@ [Activity] name = Conozco Alimentos -activity_version = 1 -host_version = 1 +activity_version = 2 bundle_id = org.ceibaljam.conozcoalimentos icon = conozco-alimentos exec = sugar-activity activity.Activity -license = GPL+ +license = GPLv3+ diff --git a/activity/conozco-alimentos.svg b/activity/conozco-alimentos.svg index ec700d0..99d47f0 100644 --- a/activity/conozco-alimentos.svg +++ b/activity/conozco-alimentos.svg @@ -1,134 +1,33 @@ - - - - - - - - + + +]> + + + + - - + + - + image/svg+xml - - + + - - - - - - - - - - + + + + + + + + + + - + \ No newline at end of file diff --git a/conozcoal.py b/conozcoal.py index 423e4ac..f21789b 100644..100755 --- a/conozcoal.py +++ b/conozcoal.py @@ -90,7 +90,11 @@ class Zona(): def estaAca(self,pos): """Devuelve True si la coordenada pos esta en la zona""" if pos[0] < XMAPAMAX*scale+shift_x: - colorAca = self.mapa.get_at((pos[0]-shift_x, pos[1]-shift_y)) + try: + colorAca = self.mapa.get_at((int(pos[0]-shift_x), + int(pos[1]-shift_y))) + except: # probablemente click fuera de la imagen + return False if colorAca[0] == self.claveColor: return True else: @@ -105,7 +109,7 @@ class Zona(): textrect = textrot.get_rect() textrect.center = (self.posicion[0], self.posicion[1]) pantalla.blit(textrot, textrect) - if flipAhora: + if flipAhora: pygame.display.flip() @@ -141,7 +145,7 @@ class Nivel(): def devolverAyuda(self): """Devuelve la linea de ayuda""" - self.preguntaActual = self.preguntas[self.indicePreguntaActual-1] + self.preguntaActual = self.preguntas[self.indicePreguntaActual-1] return self.preguntaActual[2].split("\\") def mostrarPregunta(self,pantalla,fuente,sufijo,prefijo): @@ -157,7 +161,7 @@ class Nivel(): textrect.center = (XCENTROPANEL,yLinea) pantalla.blit(text, textrect) yLinea = yLinea + fuente.get_height() - pygame.display.flip() + pygame.display.flip() class ConozcoAl(): @@ -216,7 +220,7 @@ class ConozcoAl(): continue if linea.find("=") == -1: linea = f.readline() - continue + continue [var,valor] = linea.strip().split("=") if var.startswith("Prefijo"): self.listaPrefijos.append( @@ -282,11 +286,12 @@ class ConozcoAl(): (int(600*scale+shift_x), int(800*scale+shift_y)), (255,155,155)) - pygame.display.flip() + pygame.display.flip() while 1: for event in wait_events(): if event.type == pygame.KEYDOWN: - self.click.play() + if self.sound: + self.click.play() self.pantalla.blit(self.pantallaTemp,(0,0)) pygame.display.flip() return @@ -339,11 +344,13 @@ class ConozcoAl(): for event in wait_events(): if event.type == pygame.KEYDOWN: if event.key == 27: # escape: volver - self.click.play() + if self.sound: + self.click.play() self.elegir_directorio = True return elif event.type == pygame.MOUSEBUTTONDOWN: - self.click.play() + if self.sound: + self.click.play() pos = event.pos if pos[1] > 275*scale + shift_y: # zona de opciones if pos[0] < 600*scale + shift_x: # primera columna @@ -415,14 +422,18 @@ class ConozcoAl(): self.camino_sonidos = os.path.join(CAMINORECURSOS, CAMINOCOMUN, CAMINOSONIDOS) - self.click = pygame.mixer.Sound(os.path.join(\ - self.camino_sonidos,"junggle_btn045.wav")) - self.click.set_volume(0.2) + self.sound = True + try: + self.click = pygame.mixer.Sound(os.path.join(\ + self.camino_sonidos,"junggle_btn045.wav")) + self.click.set_volume(0.2) + except: + self.sound = False # cargar fuentes self.fuente48 = pygame.font.Font(os.path.join(CAMINORECURSOS,\ CAMINOCOMUN,\ CAMINOFUENTES,\ - "AllCaps.ttf"), + "Share-Regular.ttf"), int(48*scale)) self.fuente40 = pygame.font.Font(os.path.join(CAMINORECURSOS,\ CAMINOCOMUN,\ @@ -490,7 +501,7 @@ class ConozcoAl(): textrect.center = (int(XCENTROPANEL*scale+shift_x),yLinea) self.pantalla.blit(text, textrect) yLinea = yLinea + self.fuente32.get_height() + int(10*scale) - pygame.display.flip() + pygame.display.flip() def borrarGlobito(self): """ Borra el globito, lo deja en blanco""" @@ -506,7 +517,7 @@ class ConozcoAl(): self.mostrarGlobito([self.listaCorrecto[self.correctoActual]]) self.esCorrecto = True pygame.time.set_timer(EVENTORESPUESTA,TIEMPORESPUESTA) - + def mal(self): """Muestra texto en el globito cuando la respuesta es incorrecta""" self.malActual = random.randint(1,self.numeroMal)-1 @@ -556,11 +567,13 @@ class ConozcoAl(): for event in wait_events(): if event.type == pygame.KEYDOWN: if event.key == 27: # escape: salir - self.click.play() + if self.sound: + self.click.play() pygame.time.set_timer(EVENTORESPUESTA,0) return elif event.type == pygame.MOUSEBUTTONDOWN: - self.click.play() + if self.sound: + self.click.play() if self.avanceNivel < TOTALAVANCE: if event.pos[0] < XMAPAMAX*scale+shift_x: # zona mapa self.borrarGlobito() @@ -629,7 +642,7 @@ class ConozcoAl(): pygame.display.flip() # ir al juego self.jugarNivel() - + def main(): juego = ConozcoAl() diff --git a/olpcgames/__init__.py b/olpcgames/__init__.py index 504388c..504388c 100644..100755 --- a/olpcgames/__init__.py +++ b/olpcgames/__init__.py diff --git a/olpcgames/_cairoimage.py b/olpcgames/_cairoimage.py index 3cfa22c..3cfa22c 100644..100755 --- a/olpcgames/_cairoimage.py +++ b/olpcgames/_cairoimage.py diff --git a/olpcgames/_gtkmain.py b/olpcgames/_gtkmain.py index 33a6a83..33a6a83 100644..100755 --- a/olpcgames/_gtkmain.py +++ b/olpcgames/_gtkmain.py diff --git a/olpcgames/_version.py b/olpcgames/_version.py index 6a4e1db..6a4e1db 100644..100755 --- a/olpcgames/_version.py +++ b/olpcgames/_version.py diff --git a/olpcgames/activity.py b/olpcgames/activity.py index d4a2b5a..d4a2b5a 100644..100755 --- a/olpcgames/activity.py +++ b/olpcgames/activity.py diff --git a/olpcgames/buildmanifest.py b/olpcgames/buildmanifest.py index 899433b..899433b 100644..100755 --- a/olpcgames/buildmanifest.py +++ b/olpcgames/buildmanifest.py diff --git a/olpcgames/camera.py b/olpcgames/camera.py index 249f295..249f295 100644..100755 --- a/olpcgames/camera.py +++ b/olpcgames/camera.py diff --git a/olpcgames/canvas.py b/olpcgames/canvas.py index 2583827..2583827 100644..100755 --- a/olpcgames/canvas.py +++ b/olpcgames/canvas.py diff --git a/olpcgames/data/__init__.py b/olpcgames/data/__init__.py index 8510186..8510186 100644..100755 --- a/olpcgames/data/__init__.py +++ b/olpcgames/data/__init__.py diff --git a/olpcgames/data/sleeping_svg.py b/olpcgames/data/sleeping_svg.py index c52398a..c52398a 100644..100755 --- a/olpcgames/data/sleeping_svg.py +++ b/olpcgames/data/sleeping_svg.py diff --git a/olpcgames/dbusproxy.py b/olpcgames/dbusproxy.py index a103e28..a103e28 100644..100755 --- a/olpcgames/dbusproxy.py +++ b/olpcgames/dbusproxy.py diff --git a/olpcgames/eventwrap.py b/olpcgames/eventwrap.py index 402109c..402109c 100644..100755 --- a/olpcgames/eventwrap.py +++ b/olpcgames/eventwrap.py diff --git a/olpcgames/gtkEvent.py b/olpcgames/gtkEvent.py index 6b20102..6b20102 100644..100755 --- a/olpcgames/gtkEvent.py +++ b/olpcgames/gtkEvent.py diff --git a/olpcgames/mesh.py b/olpcgames/mesh.py index 1ad4c43..1ad4c43 100644..100755 --- a/olpcgames/mesh.py +++ b/olpcgames/mesh.py diff --git a/olpcgames/pangofont.py b/olpcgames/pangofont.py index 441dfd1..441dfd1 100644..100755 --- a/olpcgames/pangofont.py +++ b/olpcgames/pangofont.py diff --git a/olpcgames/pausescreen.py b/olpcgames/pausescreen.py index 113a0ea..113a0ea 100644..100755 --- a/olpcgames/pausescreen.py +++ b/olpcgames/pausescreen.py diff --git a/olpcgames/svgsprite.py b/olpcgames/svgsprite.py index ad247dd..ad247dd 100644..100755 --- a/olpcgames/svgsprite.py +++ b/olpcgames/svgsprite.py diff --git a/olpcgames/textsprite.py b/olpcgames/textsprite.py index 7663630..7663630 100644..100755 --- a/olpcgames/textsprite.py +++ b/olpcgames/textsprite.py diff --git a/olpcgames/util.py b/olpcgames/util.py index 49a23b0..49a23b0 100644..100755 --- a/olpcgames/util.py +++ b/olpcgames/util.py diff --git a/olpcgames/video.py b/olpcgames/video.py index 032aa13..032aa13 100644..100755 --- a/olpcgames/video.py +++ b/olpcgames/video.py diff --git a/recursos/comun/datos/creditos.txt b/recursos/comun/datos/creditos.txt index 6414f9a..a6ae2ef 100644 --- a/recursos/comun/datos/creditos.txt +++ b/recursos/comun/datos/creditos.txt @@ -1,9 +1,11 @@ -Autor: Alan Aguiar -Por consultas, dudas, sugerencias: alanjas@hotmail.com +Autor: Alan Aguiar (alanjas@gmail.com) +Idea original: Ana Cichero (ana.cichero@gmail.com) +Se agradecen todo tipo de consultas, dudas, sugerencias... Este programa es software libre y desarrollado por la comunidad Por más información visitá http://ceibaljam.org +Basado en "Conozco Uruguay". Autor: Gabriel Eirea (geirea@gmail.com) Sonidos bajados de freesound.org: btn045.wav gentileza de junggle Fuentes bajadas de urbanfonts.com: AllCaps.ttf gentileza de BobFrantic y -Share-Regular.ttf gentileza de Anónimo +Share-Regular.ttf gentileza de Anónimo \ No newline at end of file diff --git a/recursos/comun/fuentes/AllCaps.ttf b/recursos/comun/fuentes/AllCaps.ttf deleted file mode 100644 index f73338f..0000000 --- a/recursos/comun/fuentes/AllCaps.ttf +++ /dev/null Binary files differ diff --git a/recursos/comun/imagenes/LICENSE b/recursos/comun/imagenes/LICENSE index 2c92af3..2a29d1f 100644 --- a/recursos/comun/imagenes/LICENSE +++ b/recursos/comun/imagenes/LICENSE @@ -8,3 +8,4 @@ California, 94105, USA. Todas las imágenes fueron creadas por Gabriel Eirea, menos terron.png que fue creada por Alejandro Rodríguez Juele. +El cocinero, cuya lamina es "Bicho.png" fue extraida de www.shutterstock.com \ No newline at end of file diff --git a/recursos/comun/imagenes/bicho.png b/recursos/comun/imagenes/bicho.png index 4686238..d867791 100644 --- a/recursos/comun/imagenes/bicho.png +++ b/recursos/comun/imagenes/bicho.png Binary files differ diff --git a/recursos/comun/imagenes/terron.png b/recursos/comun/imagenes/terron.png index 375a8aa..61ee9b7 100644 --- a/recursos/comun/imagenes/terron.png +++ b/recursos/comun/imagenes/terron.png Binary files differ diff --git a/recursos/lamina/niveles.txt b/recursos/lamina/niveles.txt index e99666d..00607cb 100644 --- a/recursos/lamina/niveles.txt +++ b/recursos/lamina/niveles.txt @@ -30,7 +30,7 @@ Pregunta = la fruta con la\que se hace el vino|10|Son de color morado Pregunta = la fruta de color\rojo más común en\las ensaladas|15|En la lámina hay dos Pregunta = la fruta que contiene\casi un 85 por\ciento de agua|15|En la lámina hay dos Pregunta = el lácteo que\comunmente se\come con cereales|20|Son dos potecitos -Pregunta = el lácteo que\comunmente se\come con cereales|21|Hay una caja y un vaso +Pregunta = el lácteo que\comunmente se\toma con café o similar|21|Hay una caja y un vaso Pregunta = el alimento energético\no grasa que\ponemos en la tostada|22|El pote tiene\una frutilla Pregunta = la carne con mayor\proporción de grasa|27|Es roja Pregunta = un elemento para\hacer una rica tortilla,\ batimos varios…|28|Vienen de las gallinas @@ -44,16 +44,13 @@ Pregunta = el grupo de alimentos\del que obtenemos\las vitaminas|30|Esta en verd Pregunta = el grupo del que\obtenemos las proteínas|34|Esta en rojo Pregunta = el grupo de alimentos\debemos consumir más|29|Esta en amarillo Pregunta = por día debemos tomar\dos litros de...|39|Esta en el centro -Pregunta = un postre rico\y saludable puede ser|11|Es roja -Pregunta = un postre rico\y saludable puede ser|13|Su nombre\es su color -Pregunta = un postre rico\y saludable puede ser|41|Es amarilla Pregunta = el ingrediente que\debemos evitar\para evitar la\hipertensión|37|Cloruro de sodio Pregunta = para evitar las\caries no tenemos\que comer muchos|35|Son dos Pregunta = fruta que se dice\es buena para la vista|12|Es de color naranja Pregunta = una fruta\rica en potasio|41|Es amarilla Pregunta = una fruta\rica en hierro|15|Es rojo -Pregunta = una fruta que\contiene mucha\vitamina C|14|Es amarillo -Pregunta = una fruta que\contiene mucha\vitamina C|13|Es de color naranja +Pregunta = una fruta ácida que\contiene mucha\vitamina C|14|Es amarillo +Pregunta = una fruta dulce que\contiene mucha\vitamina C|13|Es de color naranja Pregunta = el elemento que\en demasia puede\atacar el higado|28|Vienen de las gallinas Pregunta = la verdura que\generalmente se\utiliza para\hacer ravioles|42|Es verde Pregunta = la verdura que\se utiliza para\hacer polenta|16|Es amarillo @@ -61,4 +58,4 @@ Pregunta = el elemento que\generalmente se\come con pan|22|Es de sabor dulce Pregunta = el elemento\que se produce\mayoritariamente en\Colonia|19|Es un lacteo Pregunta = la carne de mayor\concentración de\Omega 3 y 6|26|Vive en el agua Pregunta = una grasa insaturada|7|Es liquido -Pregunta = una grasa saturada|8|Es solido +Pregunta = una grasa saturada|8|Es solido \ No newline at end of file diff --git a/run.py b/run.py deleted file mode 100644 index b5bf78e..0000000 --- a/run.py +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env python -"""Skeleton project file mainloop for new OLPCGames users""" -import olpcgames, pygame, logging -from olpcgames import pausescreen - -log = logging.getLogger( 'conozco-alimentos run' ) -log.setLevel( logging.DEBUG ) - -def main(): - """The mainloop which is specified in the activity.py file - - "main" is the assumed function name - """ - size = (800,600) - if olpcgames.ACTIVITY: - size = olpcgames.ACTIVITY.game_size - screen = pygame.display.set_mode(size) - - clock = pygame.time.Clock() - - running = True - while running: - screen.fill( (0,0,128)) - milliseconds = clock.tick(25) # maximum number of frames per second - - # Event-management loop with support for pausing after X seconds (20 here) - events = pausescreen.get_events() - # Now the main event-processing loop - if events: - for event in events: - log.debug( "Event: %s", event ) - if event.type == pygame.QUIT: - running = False - elif event.type == pygame.KEYDOWN: - if event.key == pygame.K_ESCAPE: - running = False - pygame.display.flip() - -if __name__ == "__main__": - logging.basicConfig() - main() diff --git a/setup.py b/setup.py index cf88991..77fda74 100644..100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ #!/usr/bin/env python from sugar.activity import bundlebuilder if __name__ == "__main__": - bundlebuilder.start("conozco-alimentos") + bundlebuilder.start() -- cgit v0.9.1