diff options
-rwxr-xr-x | conozcopy.py | 60 | ||||
-rw-r--r-- | recursos/0paraguay/imagenes/rutas.png | bin | 26182 -> 26182 bytes | |||
-rw-r--r-- | recursos/0paraguay/imagenes/rutasDetectar.png | bin | 8622 -> 8622 bytes |
3 files changed, 59 insertions, 1 deletions
diff --git a/conozcopy.py b/conozcopy.py index ab8351e..1d6d5b9 100755 --- a/conozcopy.py +++ b/conozcopy.py @@ -81,6 +81,7 @@ ARCHIVOLUGARES = "ciudades.txt" ARCHIVONIVELES = "niveles.txt" ARCHIVOEXPLORACIONES = "exploraciones.txt" ARCHIVORIOS = "rios.txt" +ARCHIVORUTAS = "rutas.txt" ARCHIVOCUCHILLAS = "cuchillas.txt" ARCHIVOCREDITOS = "creditos.txt" ARCHIVOPRESENTACION = "presentacion.txt" @@ -99,6 +100,7 @@ TIEMPOREFRESCO = 250 COLORNOMBREDEPTO = (0,60,60) COLORNOMBRECAPITAL = (10,10,10) COLORNOMBRERIO = (10,10,10) +COLORNOMBRERUTA = (10,10,10) COLORNOMBREELEVACION = (10,10,10) COLORPREGUNTAS = (80,80,155) COLORPANEL = (156,158,172) @@ -315,6 +317,26 @@ class ConozcoPy(): linea = f.readline() f.close() + def cargarRutas(self): + """Carga las imagenes y los datos de las rutas""" + self.rutas = self.cargarImagen("rutas.png") + self.rutasDetectar = self.cargarImagen("rutasDetectar.png") + self.listaRutas = list() + # falta sanitizar manejo de archivo + f = open(os.path.join(self.camino_datos,ARCHIVORUTAS),"r") + linea = f.readline() + while linea: + if linea[0] == "#": + linea = f.readline() + continue + [nombreRuta,claveColor,posx,posy,rotacion] = \ + linea.strip().split("|") + nuevaRuta = Zona(self.rutasDetectar, + unicode(nombreRuta,'iso-8859-1'), + claveColor,6,(posx,posy),rotacion) + self.listaRutas.append(nuevaRuta) + linea = f.readline() + f.close() def cargarRios(self): """Carga las imagenes y los datos de los rios""" self.rios = self.cargarImagen("rios.png") @@ -551,7 +573,7 @@ class ConozcoPy(): # Adding code to exit when somebody clicked on the window # close button of pygame elif event.type == pygame.QUIT: - sis.exit() + sys.exit() def pantallaInicial(self): """Pantalla con el menu principal del juego""" @@ -1053,6 +1075,7 @@ class ConozcoPy(): self.fondo = self.cargarImagen("fondo.png") self.cargarDepartamentos() self.cargarRios() + self.cargarRutas() self.cargarCuchillas() self.cargarLugares() self.cargarNiveles() @@ -1181,6 +1204,21 @@ class ConozcoPy(): return True else: return False + elif nivel.preguntaActual[1] == 6: # RUTA + # buscar ruta correcta + encontrado = False + for d in self.listaRutas: + if d.nombre == respCorrecta: + encontrado = True + break + if d.estaAca(pos): + d.mostrarNombre(self.pantalla, + self.fuente24, + COLORNOMBRERUTA, + True) + return True + else: + return False def explorarNombres(self): """Juego principal en modo exploro.""" @@ -1191,6 +1229,8 @@ class ConozcoPy(): self.pantalla.blit(self.deptosLineas, (shift_x, shift_y)) elif i.startswith("rios"): self.pantalla.blit(self.rios, (shift_x, shift_y)) + elif i.startswith("rutas"): + self.pantalla.blit(self.rutas, (shift_x, shift_y)) elif i.startswith("cuchillas"): self.pantalla.blit(self.cuchillas, (shift_x, shift_y)) elif i.startswith("capitales"): @@ -1214,6 +1254,10 @@ class ConozcoPy(): for d in self.listaRios: d.mostrarNombre(self.pantalla,self.fuente32, COLORNOMBRERIO,False) + elif i.startswith("rutas"): + for d in self.listaRutas: + d.mostrarNombre(self.pantalla,self.fuente32, + COLORNOMBRERUTA,False) elif i.startswith("cuchillas"): for d in self.listaCuchillas: d.mostrarNombre(self.pantalla,self.fuente32, @@ -1279,6 +1323,14 @@ class ConozcoPy(): COLORNOMBRERIO, True) break + elif i.startswith("rutas"): + for d in self.listaRutas: + if d.estaAca(event.pos): + d.mostrarNombre(self.pantalla, + self.fuente24, + COLORNOMBRERUTA, + True) + break elif i.startswith("cuchillas"): for d in self.listaCuchillas: if d.estaAca(event.pos): @@ -1328,6 +1380,8 @@ class ConozcoPy(): self.pantalla.blit(self.deptosLineas, (shift_x, shift_y)) elif i.startswith("rios"): self.pantalla.blit(self.rios, (shift_x, shift_y)) + elif i.startswith("rutas"): + self.pantalla.blit(self.rutas, (shift_x, shift_y)) elif i.startswith("cuchillas"): self.pantalla.blit(self.cuchillas, (shift_x, shift_y)) elif i.startswith("capitales"): @@ -1351,6 +1405,10 @@ class ConozcoPy(): for d in self.listaRios: d.mostrarNombre(self.pantalla,self.fuente32, COLORNOMBRERIO,False) + if i.startswith("rutas"): + for d in self.listaRutas: + d.mostrarNombre(self.pantalla,self.fuente32, + COLORNOMBRERUTA,False) if i.startswith("cuchillas"): for d in self.listaCuchillas: d.mostrarNombre(self.pantalla,self.fuente32, diff --git a/recursos/0paraguay/imagenes/rutas.png b/recursos/0paraguay/imagenes/rutas.png Binary files differindex 248d9ba..0dfb873 100644 --- a/recursos/0paraguay/imagenes/rutas.png +++ b/recursos/0paraguay/imagenes/rutas.png diff --git a/recursos/0paraguay/imagenes/rutasDetectar.png b/recursos/0paraguay/imagenes/rutasDetectar.png Binary files differindex 307b882..5b4bd3a 100644 --- a/recursos/0paraguay/imagenes/rutasDetectar.png +++ b/recursos/0paraguay/imagenes/rutasDetectar.png |