Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Meyer <knny.myer@gmail.com>2011-07-31 13:34:06 (GMT)
committer Kenny Meyer <knny.myer@gmail.com>2011-07-31 13:34:06 (GMT)
commitddee22fc1247426d7d3d700d4506104e4956546f (patch)
treed1b02aa501d67ca8d4617275eb629eb116c6bdbd
parent9959854d3c8864008ff9685ea1407ab1e75a3dac (diff)
Fix showing rutas0.1
Support for rutas was previously disabled, which I've noticed a little late, as I was guiding myself by conozcouy.
-rwxr-xr-xconozcopy.py60
-rw-r--r--recursos/0paraguay/imagenes/rutas.pngbin26182 -> 26182 bytes
-rw-r--r--recursos/0paraguay/imagenes/rutasDetectar.pngbin8622 -> 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
index 248d9ba..0dfb873 100644
--- a/recursos/0paraguay/imagenes/rutas.png
+++ b/recursos/0paraguay/imagenes/rutas.png
Binary files differ
diff --git a/recursos/0paraguay/imagenes/rutasDetectar.png b/recursos/0paraguay/imagenes/rutasDetectar.png
index 307b882..5b4bd3a 100644
--- a/recursos/0paraguay/imagenes/rutasDetectar.png
+++ b/recursos/0paraguay/imagenes/rutasDetectar.png
Binary files differ