Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofer@localhost.localdomain>2013-02-08 17:52:27 (GMT)
committer Cristhofer Travieso <cristhofer@localhost.localdomain>2013-02-08 17:52:27 (GMT)
commit4b4ebc014c627b4c7ecaa272aba3cc6be5076ca0 (patch)
treeb50194b243b70a5f2a9ad9f48d7a96d789dadb55
parentd31c76ee6c3068076b38be984dceb3080bddd152 (diff)
Translate files
Signed-off-by: Cristhofer Travieso <cristhofer@localhost.localdomain>
-rw-r--r--.gitignore5
-rw-r--r--Images/_continuar2.png (renamed from Imagenes/_continuar2.png)bin5095 -> 5095 bytes
-rw-r--r--Images/_salir2.png (renamed from Imagenes/_salir2.png)bin4042 -> 4042 bytes
-rw-r--r--Images/bala.png (renamed from Imagenes/bala.png)bin379 -> 379 bytes
-rw-r--r--Images/bala2.png (renamed from Imagenes/bala2.png)bin484 -> 484 bytes
-rw-r--r--Images/biejo.png (renamed from Imagenes/biejo.png)bin1790 -> 1790 bytes
-rw-r--r--Images/buum.png (renamed from Imagenes/buum.png)bin17595 -> 17595 bytes
-rw-r--r--Images/buum_final.png (renamed from Imagenes/buum_final.png)bin889936 -> 889936 bytes
-rw-r--r--Images/continuar.png (renamed from Imagenes/continuar.png)bin2517 -> 2517 bytes
-rw-r--r--Images/continuar.xcf (renamed from Imagenes/continuar.xcf)bin4601 -> 4601 bytes
-rw-r--r--Images/continuar2.png (renamed from Imagenes/continuar2.png)bin3144 -> 3144 bytes
-rw-r--r--Images/fondo.png (renamed from Imagenes/fondo.png)bin142694 -> 142694 bytes
-rw-r--r--Images/medidas.txt (renamed from Imagenes/medidas.txt)0
-rw-r--r--Images/meteorito.png (renamed from Imagenes/meteorito.png)bin5090 -> 5090 bytes
-rw-r--r--Images/mi_nave.png (renamed from Imagenes/mi_nave.png)bin1790 -> 1790 bytes
-rw-r--r--Images/mi_nave2.png (renamed from Imagenes/mi_nave2.png)bin1780 -> 1780 bytes
-rw-r--r--Images/nave_enemiga.png (renamed from Imagenes/nave_enemiga.png)bin940 -> 940 bytes
-rw-r--r--Images/pausa.png (renamed from Imagenes/pausa.png)bin1934 -> 1934 bytes
-rw-r--r--Images/puntero.png (renamed from Imagenes/puntero.png)bin1272 -> 1272 bytes
-rw-r--r--Images/salir.png (renamed from Imagenes/salir.png)bin1896 -> 1896 bytes
-rw-r--r--Images/salir2.png (renamed from Imagenes/salir2.png)bin2262 -> 2262 bytes
-rw-r--r--README.md4
-rw-r--r--Sonido/Zeropage-Trance_Etude_2.mp3bin7293657 -> 0 bytes
-rw-r--r--Zeus/Datos/Configuracion.txt4
-rw-r--r--Zeus/Enemigos.py258
-rw-r--r--Zeus/Fuentes/segoepr.ttfbin172448 -> 0 bytes
-rw-r--r--Zeus/Graficos.py544
-rw-r--r--Zeus/Imagenes/Enemigos/_1.pngbin12265 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_1_1.pngbin12138 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_2.pngbin84844 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_2_2.pngbin83822 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_3.pngbin3747 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_4.pngbin10194 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_5.pngbin10789 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_6.pngbin13439 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_7.pngbin16110 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_bala.pngbin400 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Enemigos/_bala_2.pngbin1957 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_1.pngbin6207 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_1_2.pngbin11041 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_2.pngbin9292 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_2_2.pngbin14336 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_3.pngbin11765 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_3_2.pngbin18839 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_4.pngbin12837 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_4_2.pngbin24096 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_5.pngbin12464 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Explosiones/_5_2.pngbin46487 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Fondos/fin_del_juego.jpgbin14620 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Fondos/menu.pngbin944059 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Fondos/presentacion.pngbin877982 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Fondos/u_1.jpgbin1132348 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Fondos/u_2.jpgbin265085 -> 0 bytes
-rw-r--r--Zeus/Imagenes/Fondos/u_3.jpgbin164721 -> 0 bytes
-rw-r--r--Zeus/Imagenes/_bala.bmpbin374 -> 0 bytes
-rw-r--r--Zeus/Imagenes/bala_estado.pngbin1476 -> 0 bytes
-rw-r--r--Zeus/Imagenes/enter.pngbin10313 -> 0 bytes
-rw-r--r--Zeus/Imagenes/flechitas.GIFbin2747 -> 0 bytes
-rw-r--r--Zeus/Imagenes/hat.jpgbin2193 -> 0 bytes
-rw-r--r--Zeus/Imagenes/navecita.pngbin1160 -> 0 bytes
-rw-r--r--Zeus/Imagenes/spaceship.pngbin2008 -> 0 bytes
-rw-r--r--Zeus/Nave.py257
-rw-r--r--Zeus/Sonidos/explosion.oggbin22121 -> 0 bytes
-rw-r--r--Zeus/Sonidos/inicio.oggbin524588 -> 0 bytes
-rw-r--r--Zeus/Sonidos/juego1.oggbin2813713 -> 0 bytes
-rw-r--r--Zeus/Sonidos/menu.oggbin1034239 -> 0 bytes
-rw-r--r--Zeus/Sonidos/risa.wavbin31642 -> 0 bytes
-rw-r--r--Zeus/Zeus.bmpbin6018 -> 0 bytes
-rw-r--r--Zeus/Zeus.py325
-rw-r--r--activity/icon.svg49
-rwxr-xr-xnav.py233
-rwxr-xr-xsetup.py21
-rwxr-xr-xspace.py239
-rw-r--r--sprites_file.py155
-rw-r--r--variables.py21
75 files changed, 396 insertions, 1719 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f26f7c5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.pyc
+*.pyo
+*.mo
+*~
+
diff --git a/Imagenes/_continuar2.png b/Images/_continuar2.png
index 41d11b2..41d11b2 100644
--- a/Imagenes/_continuar2.png
+++ b/Images/_continuar2.png
Binary files differ
diff --git a/Imagenes/_salir2.png b/Images/_salir2.png
index 126fb53..126fb53 100644
--- a/Imagenes/_salir2.png
+++ b/Images/_salir2.png
Binary files differ
diff --git a/Imagenes/bala.png b/Images/bala.png
index 876c2c3..876c2c3 100644
--- a/Imagenes/bala.png
+++ b/Images/bala.png
Binary files differ
diff --git a/Imagenes/bala2.png b/Images/bala2.png
index 45b0788..45b0788 100644
--- a/Imagenes/bala2.png
+++ b/Images/bala2.png
Binary files differ
diff --git a/Imagenes/biejo.png b/Images/biejo.png
index 2319a58..2319a58 100644
--- a/Imagenes/biejo.png
+++ b/Images/biejo.png
Binary files differ
diff --git a/Imagenes/buum.png b/Images/buum.png
index 1b5a452..1b5a452 100644
--- a/Imagenes/buum.png
+++ b/Images/buum.png
Binary files differ
diff --git a/Imagenes/buum_final.png b/Images/buum_final.png
index ef867da..ef867da 100644
--- a/Imagenes/buum_final.png
+++ b/Images/buum_final.png
Binary files differ
diff --git a/Imagenes/continuar.png b/Images/continuar.png
index 96c8697..96c8697 100644
--- a/Imagenes/continuar.png
+++ b/Images/continuar.png
Binary files differ
diff --git a/Imagenes/continuar.xcf b/Images/continuar.xcf
index 24a7fd3..24a7fd3 100644
--- a/Imagenes/continuar.xcf
+++ b/Images/continuar.xcf
Binary files differ
diff --git a/Imagenes/continuar2.png b/Images/continuar2.png
index e7c7748..e7c7748 100644
--- a/Imagenes/continuar2.png
+++ b/Images/continuar2.png
Binary files differ
diff --git a/Imagenes/fondo.png b/Images/fondo.png
index b117e2c..b117e2c 100644
--- a/Imagenes/fondo.png
+++ b/Images/fondo.png
Binary files differ
diff --git a/Imagenes/medidas.txt b/Images/medidas.txt
index 321819b..321819b 100644
--- a/Imagenes/medidas.txt
+++ b/Images/medidas.txt
diff --git a/Imagenes/meteorito.png b/Images/meteorito.png
index 7ef4c92..7ef4c92 100644
--- a/Imagenes/meteorito.png
+++ b/Images/meteorito.png
Binary files differ
diff --git a/Imagenes/mi_nave.png b/Images/mi_nave.png
index 2319a58..2319a58 100644
--- a/Imagenes/mi_nave.png
+++ b/Images/mi_nave.png
Binary files differ
diff --git a/Imagenes/mi_nave2.png b/Images/mi_nave2.png
index 5259b5e..5259b5e 100644
--- a/Imagenes/mi_nave2.png
+++ b/Images/mi_nave2.png
Binary files differ
diff --git a/Imagenes/nave_enemiga.png b/Images/nave_enemiga.png
index 7c86496..7c86496 100644
--- a/Imagenes/nave_enemiga.png
+++ b/Images/nave_enemiga.png
Binary files differ
diff --git a/Imagenes/pausa.png b/Images/pausa.png
index 6911e3c..6911e3c 100644
--- a/Imagenes/pausa.png
+++ b/Images/pausa.png
Binary files differ
diff --git a/Imagenes/puntero.png b/Images/puntero.png
index dea05cd..dea05cd 100644
--- a/Imagenes/puntero.png
+++ b/Images/puntero.png
Binary files differ
diff --git a/Imagenes/salir.png b/Images/salir.png
index b5371bd..b5371bd 100644
--- a/Imagenes/salir.png
+++ b/Images/salir.png
Binary files differ
diff --git a/Imagenes/salir2.png b/Images/salir2.png
index 5420eb3..5420eb3 100644
--- a/Imagenes/salir2.png
+++ b/Images/salir2.png
Binary files differ
diff --git a/README.md b/README.md
index 8195c90..3d64008 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-nav
+space
===
-It's a starships game \ No newline at end of file
+It's a starships game
diff --git a/Sonido/Zeropage-Trance_Etude_2.mp3 b/Sonido/Zeropage-Trance_Etude_2.mp3
deleted file mode 100644
index f56994b..0000000
--- a/Sonido/Zeropage-Trance_Etude_2.mp3
+++ /dev/null
Binary files differ
diff --git a/Zeus/Datos/Configuracion.txt b/Zeus/Datos/Configuracion.txt
deleted file mode 100644
index 9367cfa..0000000
--- a/Zeus/Datos/Configuracion.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-vol_fx = 0.5
-vol_musica = 0.3
-vol_musica_menu = 0.7
-nivel = 2
diff --git a/Zeus/Enemigos.py b/Zeus/Enemigos.py
deleted file mode 100644
index aaaae55..0000000
--- a/Zeus/Enemigos.py
+++ /dev/null
@@ -1,258 +0,0 @@
-# -*- coding: UTF-8 -*-
-
-import pygame
-from pygame.locals import *
-
-import sys, os
-import random
-
-random.seed()
-
-DIRECTORIO_ZEUS = os.getcwd()+"/"
-X_ENEMIGO = 600
-LARGO_DE_ENEMIGO = 50
-LARGO_ENEMIGO_2 = 240
-VELOCIDAD_BALA = 17
-DISPARADOR_1 = 10
-DISPARADOR_2 = 70
-DISPARADOR_1_2 = 60
-DISPARADOR_2_2 = 175
-ENEMIGOS_SIMPLES = ["1", "3", "4"]
-
-VELOCIDAD_1 = 10
-VELOCIDAD_2 = 16
-VELOCIDAD_3 = 22
-
-# Imagenes
-ENEMIGO1 = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_1.png"
-ENEMIGO1_1TIRO = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_1_1.png"
-ENEMIGO2 = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_2.png"
-ENEMIGO2_FALLA = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_2_2.png"
-ENEMIGO3 = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_3.png"
-ENEMIGO4 = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_4.png"
-BALA = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_bala.png"
-BALA2 = DIRECTORIO_ZEUS+"Imagenes/Enemigos/_bala_2.png"
-
-# Sonidos
-EXPLOSION = DIRECTORIO_ZEUS+"Sonidos/explosion.ogg"
-
-# Colores
-MAGENTA = (255, 0, 255)
-
-class Enemigo(pygame.sprite.Sprite):
-
- def __init__(self, nave, numero_enemigo, zeus):
-
- pygame.sprite.Sprite.__init__(self)
-
- nivel = zeus.get_configuracion("nivel")
-
- if nivel == 1:
- self.velocidad = VELOCIDAD_1
- self.enemigo_1 = pygame.image.load(ENEMIGO1)
- self.tipo_enemigo = "1"
-
- elif nivel == 2:
- self.velocidad = VELOCIDAD_2
- self.enemigo_1 = pygame.image.load(ENEMIGO3)
- self.tipo_enemigo = "3"
-
- elif nivel == 3:
- self.velocidad = VELOCIDAD_3
- self.enemigo_1 = pygame.image.load(ENEMIGO4)
- self.tipo_enemigo = "4"
-
-
- self.image = self.enemigo_1
- self.rect = self.image.get_rect()
- self.rect.x = X_ENEMIGO
- self.nave = nave
-
- self.primera_vez = None
- self.disparos = 0
- self.explosion = 0
- self.enemigo_numero = numero_enemigo
- self.adelante = True
- self.estado = True
- self.moverse_hasta = 0
- self.tiempo = 0
-
- self.nivel = nivel
-
- self.zeus = zeus
- self.vol_FX = self.zeus.get_configuracion("vol_FX")
-
- def update(self):
-
- if self.nivel >= 2:
- if self.tiempo + 5 <= self.zeus.get_tiempo():
- bala = Bala(self.zeus.sprites, self, self.nave, tipo=self.tipo_enemigo)
- bala.disparar(DISPARADOR_1, pos_nave = self.nave.rect.y)
-
- bala = Bala(self.zeus.sprites, self, self.nave, tipo=self.tipo_enemigo)
- bala.disparar(DISPARADOR_2, pos_nave = self.nave.rect.y)
- self.tiempo = self.zeus.get_tiempo()
-
- if self.primera_vez == "izquierda":
- self.primera_vez = "ya hecha"
- self.adelante = False
-
- elif self.primera_vez == "derecha":
- self.primera_vez = "ya hecha"
- self.adelante = True
-
- elif self.primera_vez == "ya hecha":
- if self.rect.x <= 0: self.adelante = True
- elif self.rect.x >= 930: self.adelante = False
-
- if self.adelante: self.rect.x += self.velocidad
- elif not self.adelante: self.rect.x -= self.velocidad
-
- if self.explosion == 5:
- self.nave.enemigos_muertos += 1
- self.nave.sprites.remove(self)
- self.kill()
- self.estado = False
-
- if self.nivel == 1: numero = 12
- elif self.nivel == 2: numero = 22
- elif self.nivel == 3: numero = 32
-
- if self.nave.enemigos_muertos < numero:
- self.nave.generar_enemigo(1, moverse = self.rect.y)
-
- elif self.nave.enemigos_muertos >= numero:
- self.nave.generar_enemigo_final()
-
- elif self.explosion > 0 and self.explosion < 5:
- self.image = pygame.image.load(DIRECTORIO_ZEUS+"Imagenes/Explosiones/_"+str(self.explosion)+".png")
- self.explosion += 1
-
- if self.moverse_hasta and not self.rect.y >= self.moverse_hasta:
- self.rect.y += 10
-
-
- def recibir_disparo(self):
- self.disparos += 1
- self.nave.puntaje += self.velocidad
- if self.estado:
- bala = Bala(self.zeus.sprites, self, self.nave, tipo=self.tipo_enemigo)
- bala.disparar(DISPARADOR_1, pos_nave = self.nave.rect.y)
-
- bala = Bala(self.zeus.sprites, self, self.nave, tipo=self.tipo_enemigo)
- bala.disparar(DISPARADOR_2, pos_nave = self.nave.rect.y)
-
- if self.disparos == 1 and self.tipo_enemigo == "1": self.image = pygame.image.load(ENEMIGO1_1TIRO)
- elif self.disparos == 2 and self.tipo_enemigo == "1": self.explotar()
- elif self.disparos == 3 and self.tipo_enemigo == "3": self.explotar()
- elif self.disparos == 4 and self.tipo_enemigo == "4": self.explotar()
-
- def explotar(self):
- explosion = pygame.mixer.Sound(EXPLOSION)
- explosion.set_volume(self.vol_FX)
- explosion.play()
- pygame.time.wait(1)
- self.explosion = 1
- self.rect.y -= 20
-
-class Enemigo_Final(pygame.sprite.Sprite):
-
- def __init__(self, nave, zeus):
-
- pygame.sprite.Sprite.__init__(self)
-
- self.enemigo_2 = pygame.image.load(ENEMIGO2)
- self.image = self.enemigo_2
- self.rect = self.image.get_rect()
- self.rect.x = 300
- self.nave = nave
-
- self.explosion = 0
- self.moverse_hasta = 200
- self.estado = False
- self.disparos = 0
-
- self.zeus = zeus
- self.vol_FX = self.zeus.get_configuracion("vol_FX")
-
- def update(self):
-
- if self.explosion == 6:
- self.nave.enemigos_muertos += 1
- self.nave.sprites.remove(self)
- self.kill()
- self.estado = False
-
- elif self.explosion > 0 and self.explosion < 6:
- self.image = pygame.image.load(DIRECTORIO_ZEUS+"Imagenes/Explosiones/_"+str(self.explosion)+"_2.png")
- self.explosion += 1
-
- if self.moverse_hasta and not self.rect.y >= self.moverse_hasta:
- self.rect.y += 5
-
- elif self.moverse_hasta and self.rect.y >= self.moverse_hasta:
- self.estado = True
-
-
- def recibir_disparo(self):
- self.disparos += 1
- self.nave.puntaje += 15
- if self.estado:
- bala = Bala(self.zeus.sprites, self, self.nave, tipo=2)
- bala.disparar(DISPARADOR_1_2)
-
- bala = Bala(self.zeus.sprites, self, self.nave, tipo=2)
- bala.disparar(DISPARADOR_2_2)
-
- if self.disparos == 1: self.image = pygame.image.load(ENEMIGO2_FALLA)
- elif self.disparos == 15:
- explosion = pygame.mixer.Sound(EXPLOSION)
- explosion.set_volume(self.vol_FX)
- explosion.play()
- pygame.time.wait(1)
- self.explosion = 1
- self.rect.x += 20
- self.rect.y += 20
-
-class Bala(pygame.sprite.Sprite):
-
- def __init__(self, sprites, enemigo, nave, tipo=1):
-
- pygame.sprite.Sprite.__init__(self)
-
- if tipo == 2:
- self.image = pygame.image.load(BALA2)
-
- else:
- self.image = pygame.image.load(BALA)
-
- self.image.set_colorkey(MAGENTA)
-
- self.rect = self.image.get_rect()
- self.rect.x, self.rect.y = enemigo.rect.x, enemigo.rect.y
-
- self.disparo = False
- self.sprites = sprites
- self.enemigo = enemigo
- self.nave = nave
- self.tipo = tipo
- self.posicion_de_nave = None
-
- def update(self):
- if self.disparo: self.rect.y += VELOCIDAD_BALA
- if self.posicion_de_nave and self.rect.y >= self.posicion_de_nave:
- self.sprites.remove(self)
- self.kill()
-
- if self.enemigo.estado and pygame.sprite.collide_rect(self.nave, self):
- self.nave.recibir_disparo(self.tipo)
- self.sprites.remove(self)
- self.kill()
-
- def disparar(self, disparador, pos_nave = None):
- self.posicion_de_nave = pos_nave
-
- self.sprites.add(self)
- self.disparo = True
- if self.tipo == 1: self.rect.x, self.rect.y = self.enemigo.rect.x+disparador, self.enemigo.rect.y + LARGO_DE_ENEMIGO
- elif self.tipo == 2: self.rect.x, self.rect.y = self.enemigo.rect.x+disparador, self.enemigo.rect.y + LARGO_ENEMIGO_2
diff --git a/Zeus/Fuentes/segoepr.ttf b/Zeus/Fuentes/segoepr.ttf
deleted file mode 100644
index 5951172..0000000
--- a/Zeus/Fuentes/segoepr.ttf
+++ /dev/null
Binary files differ
diff --git a/Zeus/Graficos.py b/Zeus/Graficos.py
deleted file mode 100644
index 39e420d..0000000
--- a/Zeus/Graficos.py
+++ /dev/null
@@ -1,544 +0,0 @@
-# -*- coding: UTF-8 -*-
-
-import pygame
-from pygame.locals import *
-
-import os, sys
-
-DIRECTORIO_ZEUS = os.getcwd()+"/"
-
-NARANJA = ( 225, 112, 5 )
-VERDE = ( 0, 225, 0 )
-ROJO = ( 225, 0, 0 )
-MAGENTA = ( 255, 0, 255 )
-NEGRO = ( 0, 0, 0 )
-AZUL = ( 0, 0, 225 )
-BLANCO = ( 225, 225, 225 )
-VIOLETA = ( 170, 0, 225 )
-CELESTE = ( 0, 225, 225 )
-FUENTE_BARRA = DIRECTORIO_ZEUS+"Fuentes/segoepr.ttf"
-
-BALA = pygame.image.load(DIRECTORIO_ZEUS+"Imagenes/bala_estado.png")
-
-class Menu(pygame.sprite.OrderedUpdates):
-
- def __init__(self, zeus):
-
- pygame.sprite.OrderedUpdates.__init__(self)
-
- self.zeus = zeus
-
- # Jugar:
- jugar = Boton(texto="Jugar!", tamanio=(248, 58), tamanio_fuente=25, pos_texto=(80, 5), funcion=self.jugar)
- jugar.moverse_hasta = 300
- jugar.set_x(512)
- jugar.set_activado()
-
- # Instrucciones
- ayuda = Boton(texto="Instrucciones",tamanio_fuente=25, dialogo=self, funcion=zeus.set_pausa, tamanio=(248, 58))
- ayuda.moverse_hasta = 358
- ayuda.set_x(512)
-
- # Opciones:
- opciones = Boton(texto="Opciones", tamanio_fuente=25,dialogo=self, tamanio=(248, 58))
- opciones.moverse_hasta = 416
- opciones.set_x(512)
-
- # Creditos:
- creditos = Boton(texto="Creditos", tamanio_fuente=25,dialogo=self, tamanio=(248, 58))
- creditos.moverse_hasta = 474
- creditos.set_x(512)
-
- # Salir:
- salir = Boton(texto="Salir", tamanio_fuente=25, dialogo=self, tamanio=(248, 58), funcion=exit)
- salir.moverse_hasta = 532
- salir.set_x(512)
-
- # ******* OPCIONES *******
-
- configuracion = self.zeus.get_configuracion("todo")
-
- # volumen FX:
- vol_fx = HEscala(configuracion=configuracion["vol_FX"])
- vol_fx.moverse_hasta = 300
- vol_fx.rect.x = 512
- vol_fx.set_activado()
-
- # volumen musica:
- vol_musica = HEscala(configuracion=configuracion["vol_musica"], texto="Volumen musica")
- vol_musica.moverse_hasta = 300
- vol_musica.rect.x = 512
-
- # volumen musica del menu:
- vol_musica_menu = HEscala(configuracion=configuracion["vol_musica_menu"], texto="Volumen musica del menu")
- vol_musica_menu.moverse_hasta = 300
- vol_musica_menu.rect.x = 512
-
- # Boton Volver
- volver = Boton(texto="Volver", dialogo=self, funcion=self.main_dialog, color_fondo=NARANJA, color_texto_2=VERDE, color_texto_1=BLANCO)
- volver.moverse_hasta = 300
- volver.set_x(512)
-
-
- self.add(ayuda)
- self.add(creditos)
- self.add(opciones)
- self.add(salir)
- self.add(vol_fx)
- self.add(vol_musica)
- self.add(vol_musica_menu)
- self.add(volver)
- self.add(jugar)
-
- self.pos = 0
- self.estado = "menu"
-
- self.botones = [jugar, ayuda, opciones, creditos, salir]
- self.botones_opciones = [vol_fx, vol_musica, vol_musica_menu, volver]
-
-
- def actualizar_eventos(self, evento):
-
- if evento.type == KEYDOWN:
- if evento.key == K_UP:
- if self.pos > 0: self.pos -= 1
- else: self.pos = len(self.botones) -1
-
- elif evento.key == K_DOWN:
- if self.pos < len(self.botones) -1: self.pos += 1
- else: self.pos = 0
-
- if self.estado == "menu":
-
- for boton in self.botones:
- boton.set_activado(False)
-
- self.botones[self.pos].set_activado(True)
-
- elif self.estado == "opciones":
- for boton in self.botones_opciones:
- boton.set_activado(False)
-
- self.botones_opciones[self.pos].set_activado(True)
-
-
- def escape(self):
- if self.botones[0].texto == "Opciones": self.main_dialog()
-
-
- def main_dialog(self):
- self.estado = "menu"
-
- for x in self.botones_opciones:
- x.hacia = "arriba"
- x.moverse_hasta = 300
-
- self.botones[0].set_texto("Jugar!")
- self.botones[0].set_pos_texto((80, 5))
- self.botones[0].set_activado()
-
- self.botones[1].moverse_hasta = 350
- self.botones[1].hacia = "abajo"
-
- self.botones[2].moverse_hasta = 416
- self.botones[2].hacia = "abajo"
-
- self.botones[3].moverse_hasta = 474
- self.botones[3].hacia = "abajo"
-
- self.botones[4].moverse_hasta = 532
- self.botones[4].hacia = "abajo"
-
-
- def opciones(self):
- self.estado = "opciones"
- self.pos = 0
- for x in self.botones:
- if not self.botones.index(x) == 0:
- x.hacia = "arriba"
- x.moverse_hasta = 300
- else:
- x.color_fondo = NEGRO
- x.color_texto_2 = NARANJA
- x.color_texto_1 = NARANJA
- x.set_texto("Opciones")
- x.set_pos_texto((70, 5))
-
- self.botones_opciones[0].moverse_hasta = 358
- self.botones_opciones[1].moverse_hasta = 406
- self.botones_opciones[2].moverse_hasta = 454
- self.botones_opciones[3].moverse_hasta = 502
-
- def jugar(self):
- self.zeus.sprites.remove(self)
- self.zeus.estado = "en_juego"
- self.zeus.RunJuego()
-
-class Barra_de_estado(pygame.sprite.Sprite):
-
- def __init__(self, nave):
-
- pygame.sprite.Sprite.__init__(self)
-
- self.superficie = pygame.surface.Surface((1024, 45), flags=HWSURFACE)
- self.fondo = nave.zeus.get_fondo("en_juego")
-
- self.superficie.blit(self.fondo, (0,0))
-
- self.image = self.superficie
- self.rect = self.superficie.get_rect()
-
- self.nave = nave
-
- self.fuente = pygame.font.Font(FUENTE_BARRA, 20)
-
- def update(self):
- self.superficie.blit(self.fondo, (0,0))
-
- balas = self.fuente.render(str(self.nave.balas_disponibles), 1, NARANJA)
-
- barra = Barra_de_progreso()
- barra.set_porcentaje(self.nave.vida)
-
- puntaje = self.nave.puntaje
-
- cuadro = Cuadro_informacion()
- cuadro.actualizar(["Puntos: "+str(puntaje), "Muertes: "+str(self.nave.enemigos_muertos)])
-
- self.superficie.blit(barra, (20,20))
- self.superficie.blit(BALA, (392, 15))
- self.superficie.blit(balas, (432, 15))
- self.superficie.blit(cuadro, (700, 10))
-
-class Barra_de_progreso(pygame.surface.Surface):
-
- def __init__(self):
-
- pygame.surface.Surface.__init__(self, (150, 20), flags=HWSURFACE)
- self.fill(NARANJA)
- self.fuente = pygame.font.Font(FUENTE_BARRA, 12)
-
- self.set_porcentaje(0)
-
- def set_porcentaje(self, porcentaje):
- if porcentaje >= 0:
- pixels = porcentaje * 150 / 100
-
- self.fill(ROJO)
- borde1 = pygame.draw.rect(self, NEGRO, (0, 0, 150, 20), 3)
-
- barra = pygame.surface.Surface((pixels, 20), flags=HWSURFACE)
- barra.fill(VERDE)
- borde = pygame.draw.rect(barra, NEGRO, (0, 0, pixels, 20), 3)
-
- texto = self.fuente.render("Energia "+str(porcentaje)+"%", 1, AZUL)
-
- self.blit(barra, (0,0))
- self.blit(texto, (30, 0))
-
-
-class Cuadro_informacion(pygame.surface.Surface):
-
- def __init__(self):
- pygame.surface.Surface.__init__(self, (220, 35), flags=HWSURFACE)
- self.fuente = pygame.font.Font(FUENTE_BARRA, 14)
- self.set_colorkey(NEGRO)
- self.fill(NEGRO)
-
- def actualizar(self, info = ["Puntos: 0", "Muertes: 0"]):
- cuadro = pygame.draw.rect(self, NARANJA, (0, 0, 220, 35), 1)
- linea = pygame.draw.line(self, NARANJA, (110, 0), (110, 35))
-
- texto1 = self.fuente.render(info[0], 1, BLANCO)
- texto2 = self.fuente.render(info[1], 1, BLANCO)
-
- self.blit(texto1, (5, 5))
- self.blit(texto2, (120, 5))
-
-class Pausa(pygame.sprite.OrderedUpdates):
-
- def __init__(self, zeus):
-
- pygame.sprite.OrderedUpdates.__init__(self)
-
- self.zeus = zeus
-
- # Pausa:
- pausa = Boton(texto="Pausa", color_fondo=NEGRO, color_texto_1=NARANJA, tamanio_fuente=25, pos_texto=(80, 5))
- pausa.moverse_hasta = 240
- pausa.set_x(384)
- pausa.set_activado(False)
-
- # Boton Volver
- volver = Boton(texto="Volver", dialogo=self, funcion=zeus.set_pausa)
- volver.moverse_hasta = 300
- volver.set_x(384)
- volver.set_activado()
-
- # Opciones:
- opciones = Boton(texto="Opciones", dialogo=self)
- opciones.moverse_hasta = 348
- opciones.set_x(384)
-
- # Menu Principal:
- menu = Boton(texto="Menu Principal", dialogo=self, funcion=self.ir_menu)
- menu.moverse_hasta = 396
- menu.set_x(384)
-
- self.add(menu)
- self.add(opciones)
- self.add(volver)
- self.add(pausa)
-
- self.pos = 1
-
- self.botones = [pausa, volver, opciones, menu]
- self.botones_opciones = []
-
- def ir_menu(self):
- self.zeus.nave.borrar_todo()
- self.destruir()
- self.zeus.estado = "menu"
- self.zeus.RunMenu()
-
- def actualizar_eventos(self, evento):
-
- if evento.type == KEYDOWN:
- if evento.key == K_UP:
- if self.pos > 1: self.pos -= 1
- else: self.pos = 3
-
- elif evento.key == K_DOWN:
- if self.pos < 3: self.pos += 1
- else: self.pos = 1
-
- for boton in self.botones:
- boton.set_activado(False)
-
- self.botones[self.pos].set_activado(True)
-
- if self.zeus.joystick:
- h = self.joystick.get_hat(0)
-
- if h[0] == -1:
- if self.pos > 1: self.pos -= 1
- else: self.pos = 3
-
- elif h[0] == 1:
- if self.pos < 3: self.pos += 1
- else: self.pos = 1
-
- def escape(self):
- if self.botones[0].texto == "Opciones": self.main_dialog()
- else:
- for boton in self.botones:
- boton.hacia = "arriba"
- boton.moverse_hasta = 10
-
- def destruir(self):
- self.zeus.sprites.remove(self)
- self.zeus.pausa = False
-
- def main_dialog(self):
- for x in self.botones_opciones:
- x.hacia = "arriba"
- x.moverse_hasta = 240
-
- self.botones[0].set_texto("Pausa")
- self.botones[0].set_pos_texto((80, 5))
-
- self.botones[1].moverse_hasta = 300
- self.botones[1].hacia = "abajo"
-
- self.botones[2].moverse_hasta = 348
- self.botones[2].hacia = "abajo"
-
- self.botones[3].moverse_hasta = 396
- self.botones[3].hacia = "abajo"
-
-
- def opciones(self):
- for x in self.botones:
- if not self.botones.index(x) == 0:
- x.hacia = "arriba"
- x.moverse_hasta = 240
- else:
- x.set_texto("Opciones")
- x.set_pos_texto((70, 5))
-
-
-class Boton(pygame.sprite.Sprite):
-
- def __init__(self,
- texto="",
- tamanio = (248, 48),
- tamanio_fuente=20,
- color_fondo=NARANJA,
- dialogo=None,
- funcion=None,
- color_texto_1=NEGRO,
- color_texto_2=BLANCO,
- pos_texto=(60, 10)):
-
- pygame.sprite.Sprite.__init__(self)
-
- self.fuente = pygame.font.Font(FUENTE_BARRA, tamanio_fuente)
- self.activado = False
- self.texto = texto
- self.color_fondo = color_fondo
- self.color_texto_1 = color_texto_1
- self.color_texto_2 = color_texto_2
- self.pos_texto = pos_texto
- self.superficie = pygame.surface.Surface(tamanio, flags=HWSURFACE)
-
- self.moverse_hasta = 0
- self.hacia = "abajo"
-
- self.image = self.get_surface(texto)
- self.rect = self.image.get_rect()
-
- self.rect.x, self.rect.y = 300, 0
-
- if self.color_fondo == MAGENTA: self.superficie.set_colorkey(MAGENTA)
-
- self.dialogo = dialogo
- self.funcion = funcion
-
- def set_texto(self, texto): self.texto = texto
- def set_pos_texto(self, pos): self.pos_texto = pos
-
- def get_surface(self, texto):
- self.superficie.fill(self.color_fondo)
-
- if self.activado:
- self.superficie.fill(self.color_texto_1)
- texto_boton = self.fuente.render(texto, 1, self.color_fondo)
- imagen = pygame.image.load(DIRECTORIO_ZEUS+"Imagenes/navecita.png")
-
- self.superficie.blit(imagen, (0,0))
-
- elif not self.activado:
- texto_boton = self.fuente.render(texto, 1, self.color_texto_1)
-
-
- self.superficie.blit(texto_boton, self.pos_texto)
-
-
- return self.superficie
-
- def set_x(self, x):
- self.rect.x = x
-
- def set_activado(self, tf=True):
- self.activado = tf
- self.image = self.get_surface(self.texto)
-
- def update(self):
- self.image = self.get_surface(self.texto)
-
- if self.moverse_hasta and not self.rect.y >= self.moverse_hasta and not self.hacia == "arriba":
- self.rect.y += 10
-
- elif self.moverse_hasta and not self.rect.y <= self.moverse_hasta and not self.hacia == "abajo":
- self.rect.y -= 10
-
- if self.texto == "Menu Principal" and self.dialogo and self.hacia == "arriba" and self.rect.y == 10: self.dialogo.destruir()
-
- teclas = pygame.key.get_pressed()
-
- if teclas[K_RETURN] and self.activado and self.funcion: self.funcion()
- if teclas[K_RETURN] and self.activado and self.dialogo and self.texto == "Opciones": self.dialogo.opciones()
-
- if self.dialogo and self.dialogo.zeus.joystick:
- if self.dialogo.zeus.joystick.get_button(2) and self.activado and self.funcion: self.funcion()
- elif self.dialogo.zeus.joystick.get_button(2) and self.activado and self.dialogo and self.texto == "Opciones": self.dialogo.opciones()
-
-class HEscala(pygame.sprite.Sprite):
-
- def __init__(self,
- texto = "Volumen FX",
- pos_texto = (60, 30),
- configuracion = 0,
- color_fondo_barra=NEGRO,
- color_fondo=NARANJA,
- color_control=VERDE):
-
- pygame.sprite.Sprite.__init__(self)
-
- self.fuente = pygame.font.Font(FUENTE_BARRA, 9)
-
- self.color_fondo = color_fondo
- self.color_control = color_control
- self.color_fondo_barra = color_fondo_barra
- self.texto = texto
- self.pos_texto = pos_texto
-
- self.superficie = pygame.surface.Surface((248, 48), flags=HWSURFACE)
-
- self.moverse_hasta = 300
- self.hacia = "abajo"
- self.pos = configuracion
-
- self.activado = False
-
- self.image = self.get_surface(texto)
- self.rect = self.image.get_rect()
-
- self.rect.x, self.rect.y = 512, 0
-
- if self.color_fondo == MAGENTA: self.superficie.set_colorkey(MAGENTA)
-
-
-
- def get_surface(self, texto):
- self.superficie.fill(self.color_fondo)
- color = BLANCO
-
- if self.activado: color = self.color_control
-
- sup = pygame.surface.Surface((150, 20), flags=HWSURFACE)
-
- sup.fill(self.color_fondo_barra)
- borde1 = pygame.draw.rect(sup, NEGRO, (0, 0, 150, 20), 3)
-
- barra = pygame.surface.Surface((20, 20), flags=HWSURFACE)
- barra.fill(color)
- borde = pygame.draw.rect(barra, NEGRO, (0, 0, 20, 20), 3)
-
- sup.blit(barra, (self.pos, 0))
-
- tipo = self.fuente.render(texto, 1, BLANCO)
-
- self.superficie.blit(sup, (49, 5))
- self.superficie.blit(tipo, self.pos_texto)
-
- return self.superficie
-
- def set_x(self, x):
- self.rect.x = x
-
- def get_pos(self, maximo):
- pos = self.pos * 150 / maximo
- return pos
-
- def set_activado(self, tf=True):
- self.activado = tf
- self.image = self.get_surface(self.texto)
-
- def update(self):
- self.image = self.get_surface(self.texto)
-
- if self.moverse_hasta and not self.rect.y >= self.moverse_hasta and not self.hacia == "arriba":
- self.rect.y += 10
-
- elif self.moverse_hasta and not self.rect.y <= self.moverse_hasta and not self.hacia == "abajo":
- self.rect.y -= 10
-
- print self.pos
-
-
- if self.activado:
- teclas = pygame.key.get_pressed()
-
- if teclas[K_LEFT] and not self.pos <= 0: self.pos -= 3
- elif teclas[K_RIGHT] and not self.pos >= 150: self.pos += 3
diff --git a/Zeus/Imagenes/Enemigos/_1.png b/Zeus/Imagenes/Enemigos/_1.png
deleted file mode 100644
index 7e35f58..0000000
--- a/Zeus/Imagenes/Enemigos/_1.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_1_1.png b/Zeus/Imagenes/Enemigos/_1_1.png
deleted file mode 100644
index 137c11d..0000000
--- a/Zeus/Imagenes/Enemigos/_1_1.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_2.png b/Zeus/Imagenes/Enemigos/_2.png
deleted file mode 100644
index c5d6b1e..0000000
--- a/Zeus/Imagenes/Enemigos/_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_2_2.png b/Zeus/Imagenes/Enemigos/_2_2.png
deleted file mode 100644
index a5f16cc..0000000
--- a/Zeus/Imagenes/Enemigos/_2_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_3.png b/Zeus/Imagenes/Enemigos/_3.png
deleted file mode 100644
index a580a0c..0000000
--- a/Zeus/Imagenes/Enemigos/_3.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_4.png b/Zeus/Imagenes/Enemigos/_4.png
deleted file mode 100644
index 0c01fb7..0000000
--- a/Zeus/Imagenes/Enemigos/_4.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_5.png b/Zeus/Imagenes/Enemigos/_5.png
deleted file mode 100644
index 1671899..0000000
--- a/Zeus/Imagenes/Enemigos/_5.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_6.png b/Zeus/Imagenes/Enemigos/_6.png
deleted file mode 100644
index 34ece32..0000000
--- a/Zeus/Imagenes/Enemigos/_6.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_7.png b/Zeus/Imagenes/Enemigos/_7.png
deleted file mode 100644
index e72d6ed..0000000
--- a/Zeus/Imagenes/Enemigos/_7.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_bala.png b/Zeus/Imagenes/Enemigos/_bala.png
deleted file mode 100644
index b51cdd0..0000000
--- a/Zeus/Imagenes/Enemigos/_bala.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Enemigos/_bala_2.png b/Zeus/Imagenes/Enemigos/_bala_2.png
deleted file mode 100644
index 2c271a1..0000000
--- a/Zeus/Imagenes/Enemigos/_bala_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_1.png b/Zeus/Imagenes/Explosiones/_1.png
deleted file mode 100644
index 3af6cfa..0000000
--- a/Zeus/Imagenes/Explosiones/_1.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_1_2.png b/Zeus/Imagenes/Explosiones/_1_2.png
deleted file mode 100644
index bf950df..0000000
--- a/Zeus/Imagenes/Explosiones/_1_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_2.png b/Zeus/Imagenes/Explosiones/_2.png
deleted file mode 100644
index 5d7baa4..0000000
--- a/Zeus/Imagenes/Explosiones/_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_2_2.png b/Zeus/Imagenes/Explosiones/_2_2.png
deleted file mode 100644
index 0be609c..0000000
--- a/Zeus/Imagenes/Explosiones/_2_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_3.png b/Zeus/Imagenes/Explosiones/_3.png
deleted file mode 100644
index 3e0f324..0000000
--- a/Zeus/Imagenes/Explosiones/_3.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_3_2.png b/Zeus/Imagenes/Explosiones/_3_2.png
deleted file mode 100644
index 7974e89..0000000
--- a/Zeus/Imagenes/Explosiones/_3_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_4.png b/Zeus/Imagenes/Explosiones/_4.png
deleted file mode 100644
index a3865b8..0000000
--- a/Zeus/Imagenes/Explosiones/_4.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_4_2.png b/Zeus/Imagenes/Explosiones/_4_2.png
deleted file mode 100644
index 930a6dd..0000000
--- a/Zeus/Imagenes/Explosiones/_4_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_5.png b/Zeus/Imagenes/Explosiones/_5.png
deleted file mode 100644
index 6a6e0ac..0000000
--- a/Zeus/Imagenes/Explosiones/_5.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Explosiones/_5_2.png b/Zeus/Imagenes/Explosiones/_5_2.png
deleted file mode 100644
index 988f1e0..0000000
--- a/Zeus/Imagenes/Explosiones/_5_2.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Fondos/fin_del_juego.jpg b/Zeus/Imagenes/Fondos/fin_del_juego.jpg
deleted file mode 100644
index 15d6b76..0000000
--- a/Zeus/Imagenes/Fondos/fin_del_juego.jpg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Fondos/menu.png b/Zeus/Imagenes/Fondos/menu.png
deleted file mode 100644
index fb9f1ce..0000000
--- a/Zeus/Imagenes/Fondos/menu.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Fondos/presentacion.png b/Zeus/Imagenes/Fondos/presentacion.png
deleted file mode 100644
index 79328c2..0000000
--- a/Zeus/Imagenes/Fondos/presentacion.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Fondos/u_1.jpg b/Zeus/Imagenes/Fondos/u_1.jpg
deleted file mode 100644
index 06022c0..0000000
--- a/Zeus/Imagenes/Fondos/u_1.jpg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Fondos/u_2.jpg b/Zeus/Imagenes/Fondos/u_2.jpg
deleted file mode 100644
index b7376a1..0000000
--- a/Zeus/Imagenes/Fondos/u_2.jpg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/Fondos/u_3.jpg b/Zeus/Imagenes/Fondos/u_3.jpg
deleted file mode 100644
index 28e74ce..0000000
--- a/Zeus/Imagenes/Fondos/u_3.jpg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/_bala.bmp b/Zeus/Imagenes/_bala.bmp
deleted file mode 100644
index f6f0248..0000000
--- a/Zeus/Imagenes/_bala.bmp
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/bala_estado.png b/Zeus/Imagenes/bala_estado.png
deleted file mode 100644
index c9c9b71..0000000
--- a/Zeus/Imagenes/bala_estado.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/enter.png b/Zeus/Imagenes/enter.png
deleted file mode 100644
index 2b00d1b..0000000
--- a/Zeus/Imagenes/enter.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/flechitas.GIF b/Zeus/Imagenes/flechitas.GIF
deleted file mode 100644
index 644f1aa..0000000
--- a/Zeus/Imagenes/flechitas.GIF
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/hat.jpg b/Zeus/Imagenes/hat.jpg
deleted file mode 100644
index 740801c..0000000
--- a/Zeus/Imagenes/hat.jpg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/navecita.png b/Zeus/Imagenes/navecita.png
deleted file mode 100644
index a5ba181..0000000
--- a/Zeus/Imagenes/navecita.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Imagenes/spaceship.png b/Zeus/Imagenes/spaceship.png
deleted file mode 100644
index 1518eaf..0000000
--- a/Zeus/Imagenes/spaceship.png
+++ /dev/null
Binary files differ
diff --git a/Zeus/Nave.py b/Zeus/Nave.py
deleted file mode 100644
index 266551e..0000000
--- a/Zeus/Nave.py
+++ /dev/null
@@ -1,257 +0,0 @@
-# -*- coding: UTF-8 -*-
-
-import pygame
-from pygame.locals import *
-
-import sys, os
-import random
-random.seed(0)
-
-import time
-import threading
-
-from Enemigos import Enemigo, Enemigo_Final
-
-DIRECTORIO_ZEUS = os.getcwd()+"/"
-
-# Numeros de pixels
-VELOCIDAD_BALA = 17
-VELOCIDAD_NAVE = 20
-CENTRO_DE_NAVE = 44
-ESPACIO_ENTRE_ENEMIGOS = 20
-CENTRO_INFERIOR = 450, 650
-TRAYECTO_DE_BALA = 450
-
-# Imagenes
-BALA = DIRECTORIO_ZEUS+"Imagenes/_bala.bmp"
-NAVE = DIRECTORIO_ZEUS+"Imagenes/spaceship.png"
-
-# Sonidos
-EXPLOSION = DIRECTORIO_ZEUS+"Sonidos/explosion.ogg"
-
-# Otros
-IZODE = ["izquierda", "derecha"]
-MAGENTA = (255, 0, 255)
-
-class Nave(pygame.sprite.Sprite):
-
- def __init__(self, sprites, zeus):
-
- pygame.sprite.Sprite.__init__(self)
-
- self.nave = pygame.image.load(NAVE)
- self.image = self.nave
- self.rect = self.image.get_rect()
- self.rect.x, self.rect.y = CENTRO_INFERIOR
- self.sprites = sprites
-
- self.enemigos = []
- self.cantidad_enemigos = 0
-
- self.zeus = zeus
- self.puntaje = 0
- self.vida = 100
- self.enemigos_muertos = 0
- self.explosion = 0
- self.hat_joy = 0
-
- self.vol_FX = zeus.get_configuracion("vol_FX")
- nivel = zeus.get_configuracion("nivel")
-
- if nivel == 1:
- self.balas_disponibles = 200
-
- elif nivel == 2:
- self.balas_disponibles = 300
-
- elif nivel == 3:
- self.balas_disponibles = 450
-
- self.nivel = nivel
-
- self.generar_enemigo(3, moverse = False)
-
-
- def update(self):
- teclas = pygame.key.get_pressed()
-
- if self.zeus.joystick != None:
- try:
-
- self.hat_joy = self.zeus.joystick.get_hat(0)
-
- if self.hat_joy == (-1, 0) and not self.rect.x <= 10: self.rect.x -= VELOCIDAD_NAVE
- elif self.hat_joy == (1, 0) and not self.rect.x >= 930: self.rect.x += VELOCIDAD_NAVE
- elif self.hat_joy == (0, -1) and not self.rect.y >= 650: self.rect.y += VELOCIDAD_NAVE
- elif self.hat_joy == (0, 1) and not self.rect.y <= 50: self.rect.y -= VELOCIDAD_NAVE
-
- elif self.hat_joy == (1, 1) and not self.rect.y <= 50:
- self.rect.y -= VELOCIDAD_NAVE
- self.rect.x += VELOCIDAD_NAVE
-
- elif self.hat_joy == (-1, -1) and not self.rect.y <= 50:
- self.rect.y += VELOCIDAD_NAVE
- self.rect.x -= VELOCIDAD_NAVE
-
- elif self.hat_joy == (-1, 1) and not self.rect.y <= 50:
- self.rect.y -= VELOCIDAD_NAVE
- self.rect.x -= VELOCIDAD_NAVE
-
- elif self.hat_joy == (1, -1) and not self.rect.y <= 50:
- self.rect.y += VELOCIDAD_NAVE
- self.rect.x += VELOCIDAD_NAVE
-
- except: pass
-
- if teclas[K_RIGHT] and not self.rect.x >= 930:
- self.rect.x += VELOCIDAD_NAVE
-
- elif teclas[K_LEFT] and not self.rect.x <= 10:
- self.rect.x -= VELOCIDAD_NAVE
-
- elif teclas[K_UP] and not self.rect.y <= 50:
- self.rect.y -= VELOCIDAD_NAVE
-
- elif teclas[K_DOWN] and not self.rect.y >= 650:
- self.rect.y += VELOCIDAD_NAVE
-
-
- for enemigo in self.enemigos:
- if pygame.sprite.collide_rect(self, enemigo) and enemigo.estado:
- self.vida -= 0.1
-
- if self.explosion == 6:
- self.sprites.remove(self)
- self.kill()
- self.estado = False
-
- self.zeus.estado = "fin_del_juego"
- self.zeus.RunFinJuego()
-
- elif self.explosion > 0 and self.explosion < 5:
- self.image = pygame.image.load(DIRECTORIO_ZEUS+"Imagenes/Explosiones/_"+str(self.explosion)+".png")
- self.explosion += 1
-
-
- if self.vida <= 0 and not self.explosion:
- explosion = pygame.mixer.Sound(EXPLOSION)
- explosion.set_volume(self.vol_FX)
- explosion.play()
- #time.sleep(1)
- self.explosion = 1
-
- def generar_enemigo(self, cantidad, moverse = False):
- for enemigo in range(cantidad):
- enemigo = Enemigo(self, self.cantidad_enemigos, self.zeus)
- enemigo.primera_vez = random.choice(IZODE)
- lista_de_y = []
- hay_elemento = False
- for y in self.enemigos:
- lista_de_y.append(y.rect.y)
- hay_elemento = True
-
- if hay_elemento and not moverse:
- enemigo.rect.y = max(lista_de_y)+100+ESPACIO_ENTRE_ENEMIGOS
-
- elif hay_elemento and moverse:
- enemigo.moverse_hasta = moverse
-
- elif not hay_elemento: enemigo.rect.y = 50+ESPACIO_ENTRE_ENEMIGOS
-
-
- self.sprites.add(enemigo)
- self.enemigos.append(enemigo)
- self.cantidad_enemigos += 1
-
- def generar_enemigo_final(self):
- enemigo = Enemigo_Final(self, self.zeus)
- for _enemigo in self.enemigos:
- self.sprites.remove(_enemigo)
- _enemigo.kill()
- del _enemigo
-
- self.enemigos = list()
- self.enemigos.append(enemigo)
- self.sprites.add(enemigo)
-
- def evento(self, event):
- if event.type == JOYBUTTONDOWN:
- if event.button == 2:
- if self.balas_disponibles:
- bala = Bala(self.sprites, self.enemigos)
- bala.disparar(self)
- self.balas_disponibles -= 1
-
- elif event.type == KEYDOWN:
- tecla = event.key
- if tecla == K_LCTRL or tecla == K_x:
- if self.balas_disponibles:
- bala = Bala(self.sprites, self.enemigos)
- bala.disparar(self)
- self.balas_disponibles -= 1
-
-
- def recibir_disparo(self, tipo):
- self.vida -= 2
- if tipo == 2: self.vida -= 8
- elif tipo == 3: self.vida -= 3
- elif tipo == 4: self.vida -= 4
-
- def borrar_todo(self):
- self.zeus.sprites.remove(self.zeus.barra_de_estado)
- self.zeus.barra_de_estado.kill()
- del self.zeus.barra_de_estado
-
- for enemigo in self.enemigos:
- enemigo.explosion = 5
-
- self.zeus.sprites.remove(self.zeus.nave)
- self.zeus.nave.kill()
-
- self.zeus.nave = None
-
-
-class Bala(pygame.sprite.Sprite):
-
- def __init__(self, sprites, enemigos):
-
- pygame.sprite.Sprite.__init__(self)
-
- self.imagen_original = pygame.image.load(BALA)
-
- self.image = self.imagen_original.copy()
- self.image.set_colorkey(MAGENTA)
- self.rect = self.image.get_rect()
- self.rect.x, self.rect.y = CENTRO_INFERIOR
-
- self.disparo = False
- self.sprites = sprites
- self.enemigos = enemigos
- self.y_de_disparo = CENTRO_INFERIOR[1]
- self.angulo = 0
-
- def update(self):
- if self.disparo: self.rect.y -= VELOCIDAD_BALA
- if self.rect.y <= self.y_de_disparo - TRAYECTO_DE_BALA:
- self.sprites.remove(self)
- self.kill()
-
-
- for enemigo in self.enemigos:
- if pygame.sprite.collide_rect(enemigo, self) and enemigo.estado:
- enemigo.recibir_disparo()
- self.sprites.remove(self)
- self.kill()
- break
-
- self.angulo += 1
- self.image = pygame.transform.rotate(self.imagen_original, self.angulo)
-
-
- def disparar(self, nave):
- self.sprites.add(self)
- self.disparo = True
- self.y_de_disparo = nave.rect.y
- self.rect.x, self.rect.y = nave.rect.x+CENTRO_DE_NAVE, nave.rect.y
-
- self.nave = nave
diff --git a/Zeus/Sonidos/explosion.ogg b/Zeus/Sonidos/explosion.ogg
deleted file mode 100644
index bf6e6a1..0000000
--- a/Zeus/Sonidos/explosion.ogg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Sonidos/inicio.ogg b/Zeus/Sonidos/inicio.ogg
deleted file mode 100644
index d127aaa..0000000
--- a/Zeus/Sonidos/inicio.ogg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Sonidos/juego1.ogg b/Zeus/Sonidos/juego1.ogg
deleted file mode 100644
index e3dc502..0000000
--- a/Zeus/Sonidos/juego1.ogg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Sonidos/menu.ogg b/Zeus/Sonidos/menu.ogg
deleted file mode 100644
index 80ae26e..0000000
--- a/Zeus/Sonidos/menu.ogg
+++ /dev/null
Binary files differ
diff --git a/Zeus/Sonidos/risa.wav b/Zeus/Sonidos/risa.wav
deleted file mode 100644
index 0c88584..0000000
--- a/Zeus/Sonidos/risa.wav
+++ /dev/null
Binary files differ
diff --git a/Zeus/Zeus.bmp b/Zeus/Zeus.bmp
deleted file mode 100644
index 5ef33e2..0000000
--- a/Zeus/Zeus.bmp
+++ /dev/null
Binary files differ
diff --git a/Zeus/Zeus.py b/Zeus/Zeus.py
deleted file mode 100644
index cc0c883..0000000
--- a/Zeus/Zeus.py
+++ /dev/null
@@ -1,325 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: UTF-8 -*-
-
-import pygame
-from pygame.locals import *
-
-from Nave import Nave, Bala
-from Graficos import Barra_de_estado, Pausa, Boton, Menu
-
-import random, os
-import s
-import time
-
-import gc
-gc.enable()
-
-# Archivos y directorios
-DIRECTORIO_ZEUS = os.getcwd()+"/"
-DATOS = DIRECTORIO_ZEUS+"Datos"
-CONFIGURACION = DATOS+"/Configuracion.txt"
-
-# Resolucion pantalla
-RESOLUCION = (1024, 768)
-
-# Imagenes
-NIVELES = [None, DIRECTORIO_ZEUS+"Imagenes/Fondos/u_1.jpg", DIRECTORIO_ZEUS+"Imagenes/Fondos/u_2.jpg", DIRECTORIO_ZEUS+"Imagenes/Fondos/u_3.jpg"]
-FIN_JUEGO = DIRECTORIO_ZEUS+"Imagenes/Fondos/fin_del_juego.jpg"
-WALLPAPER = DIRECTORIO_ZEUS+"Imagenes/Fondos/presentacion.png"
-WALLPAPER_2 = DIRECTORIO_ZEUS+"Imagenes/Fondos/menu.png"
-POS_IMG = 0, 50
-ICONO = pygame.image.load(DIRECTORIO_ZEUS+"Imagenes/spaceship.png")
-
-# Musica
-MUSICA1 = DIRECTORIO_ZEUS+"Sonidos/inicio.ogg"
-MUSICA2 = DIRECTORIO_ZEUS+"Sonidos/menu.ogg"
-MUSICA3 = DIRECTORIO_ZEUS+"Sonidos/juego1.ogg"
-
-# Fuentes
-SEGOE_PRINT = DIRECTORIO_ZEUS+"Fuentes/segoepr.ttf"
-
-# Colores
-AZUL = (0, 0, 225)
-
-# Otros
-TIEMPO_ACTUALIZACION_DE_JOYSTICKS = 5
-
-class Zeus():
-
- def __init__(self):
- self.nave = None
- self.fondo = None
- self.menu = None
- self.ventana = None
- self.reloj = None
- self.estado = None
- self.pausa = False
- self.joystick = None
- self.actualizacion_de_joysticks_tiempo = 0
- self.tiempo = 0
- self.sprites = pygame.sprite.OrderedUpdates()
-
- def Run(self):
-
- pygame.mouse.set_visible(False)
- self.fondo = self.fondo
- self.ventana.blit(self.fondo, (0,0))
- pygame.display.update()
-
- self.tiempo = 0
- while self.estado == "presentacion":
- self.reloj.tick(32)
-
- self.actualizar()
-
- def RunMenu(self):
- pygame.mixer.music.fadeout(1200)
- time.sleep(1.2)
-
- self.menu = Menu(self)
- self.sprites.add(self.menu)
-
- self.set_musica("menu")
-
- self.fondo = self.get_fondo("menu")
- self.ventana.blit(self.fondo, (0,0))
- pygame.display.update()
-
- self.tiempo = 0
- while self.estado == "menu":
- self.reloj.tick(32)
-
- self.actualizar()
-
- def RunJuego(self):
- pygame.mixer.music.fadeout(1200)
- time.sleep(1.2)
-
- self.set_musica("juego")
-
- self.nave = Nave(self.sprites, self)
- self.barra_de_estado = Barra_de_estado(self.nave)
-
- self.sprites.add(self.nave)
- self.sprites.add(self.barra_de_estado)
-
- self.sprites.clear(self.ventana, self.fondo)
- self.sprites.draw(self.ventana)
-
- self.fondo = self.get_fondo("en_juego")
- self.ventana.blit(self.fondo, (0,0))
- self.estado = "en_juego"
-
- pygame.mouse.set_visible(False)
- pygame.display.update()
-
- self.tiempo = 0
- self.pos_fondo = 0
-
- while self.estado == "en_juego":
- self.reloj.tick(32)
- self.actualizar()
-
- def RunFinJuego(self):
- self.nave.borrar_todo()
-
- self.sprites.clear(self.ventana, self.fondo)
- self.sprites.draw(self.ventana)
-
- self.fondo = self.get_fondo("fin_del_juego")
- self.ventana.blit(self.fondo, (0,0))
-
- pygame.display.update()
-
- self.tiempo = 0
-
- while self.estado == "fin_del_juego":
-
- self.reloj.tick(10)
-
- self.actualizar()
-
-
- def setup(self):
- pygame.init()
- pygame.font.init()
- pygame.mixer.init()
-
- self.actualizar_joysticks()
- self.segoepr = pygame.font.Font(SEGOE_PRINT, 30)
-
- pygame.display.set_mode(RESOLUCION, 0,0)
- pygame.display.set_caption(".: Zeus :.")
- pygame.display.set_icon(ICONO)
- #pygame.display.toggle_fullscreen()
-
- self.set_musica("inicio")
-
- self.ventana = pygame.display.get_surface()
- self.reloj = pygame.time.Clock()
- self.estado = "presentacion"
- self.fondo = self.get_fondo("inicio")
- self.sprites.draw(self.ventana)
-
- pygame.display.update()
-
- def get_fondo(self, tipo="inicio"):
- fondo = pygame.surface.Surface(RESOLUCION, flags=HWSURFACE)
-
- if tipo == "inicio":
- imagen = pygame.image.load(WALLPAPER)
- fondo.blit(imagen, POS_IMG)
- fondo.blit(self.segoepr.render(".: Presiona espacio para continuar :.", 1, AZUL), (350, 700))
-
- elif tipo == "en_juego":
- imagen = pygame.image.load(NIVELES[self.get_configuracion("nivel")])
- fondo.blit(imagen, (0,0))
-
- elif tipo == "menu":
- imagen = pygame.image.load(WALLPAPER_2)
- fondo.blit(imagen, POS_IMG)
-
- elif tipo == "fin_del_juego":
- imagen = pygame.image.load(FIN_JUEGO)
- fondo.blit(imagen, POS_IMG)
-
- else: print "Ese fondo no existe, igual se retorna una superficie en negro"
-
- return fondo
-
- def set_musica(self, tipo="incio y menu"):
- if tipo == "inicio":
- pygame.mixer.music.load(MUSICA1)
- pygame.mixer.music.play(-1, 0.0)
-
- elif tipo == "menu":
- pygame.mixer.music.load(MUSICA2)
- pygame.mixer.music.play(-1, 0.0)
-
- elif tipo == "juego":
- pygame.mixer.music.load(MUSICA3)
- pygame.mixer.music.play(-1, 0.0)
-
- def handle_event(self):
- for event in pygame.event.get():
-
- if event.type == QUIT:
- exit()
-
- elif event.type == KEYDOWN:
- if event.key == K_q: exit()
-
- elif event.key == K_ESCAPE and self.estado == "en_juego":
- self.set_pausa()
-
- if self.estado == "presentacion" and event.key == K_SPACE:
- self.estado = "menu"
- self.RunMenu()
-
-
- elif event.type == JOYBUTTONDOWN:
- if event.button == 8 and self.estado == "en_juego":
- self.set_pausa()
-
- if self.estado == "presentacion" and event.button == 0:
- self.estado = "menu"
- self.RunMenu()
-
-
- try: self.nave.evento(event)
- except: pass
- try: self.dialogo_pausa.actualizar_eventos(event)
- except: pass
- try: self.menu.actualizar_eventos(event)
- except: pass
-
-
-
- pygame.event.clear()
-
- def get_configuracion(self, tipo):
- # abrir archivo:
- config = open(CONFIGURACION, "r")
- configuracion = {"vol_FX": 0.7, "vol_musica": 0.5, "vol_musica_menu": 1.0, "nivel": 1}
-
- for cfg in config.readlines():
- variable = cfg.split(" = ")
- nombre = variable[0]
- info = variable[1]
-
- if nombre == "vol_fx":
- configuracion["vol_FX"] = float(info)
-
- elif nombre == "vol_musica":
- configuracion["vol_musica"] = float(info)
-
- elif nombre == "vol_musica_menu":
- configuracion["vol_musica_menu"] = float(info)
-
- elif nombre == "nivel":
- configuracion["nivel"] = int(info)
-
- if tipo == "vol_FX": configuracion = configuracion["vol_FX"]
- elif tipo == "vol_musica": configuracion = configuracion["vol_musica"]
- elif tipo == "vol_musica_menu": configuracion = configuracion["vol_musica_menu"]
- elif tipo == "nivel": configuracion = configuracion["nivel"]
-
- return configuracion
-
- def get_tiempo(self):
- return int(self.tiempo)
-
- def set_pausa(self):
- if not self.pausa:
- self.pausa = True
- self.dialogo_pausa = Pausa(self)
-
- self.sprites.add(self.dialogo_pausa)
-
- elif self.pausa:
- self.dialogo_pausa.escape()
-
- def actualizar(self):
-
- self.tiempo += 0.032
-
- self.actualizar_graficos()
-
- if self.actualizacion_de_joysticks_tiempo + TIEMPO_ACTUALIZACION_DE_JOYSTICKS <= self.get_tiempo():
- self.actualizar_joysticks()
- self.actualizacion_de_joysticks_tiempo = self.get_tiempo()
-
- def actualizar_graficos(self, sprites=True):
- cambios=[]
-
- if self.estado == "en_juego":
- self.pos_fondo += 1
- self.fondo = self.get_fondo(tipo = "en_juego")
-
- self.sprites.clear(self.ventana, self.fondo)
- if not self.pausa:
- self.sprites.update()
-
- elif self.pausa:
- self.dialogo_pausa.update()
- cambios.extend ( self.sprites.draw(self.ventana) )
- self.handle_event()
- if sprites: pygame.display.update(cambios)
- elif not sprites: pygame.display.update()
-
- def actualizar_joysticks(self):
- if pygame.joystick.get_init(): pygame.joystick.quit()
- elif not pygame.joystick.get_init(): self.joystick = None
- pygame.joystick.init()
-
- if pygame.joystick.get_count():
- self.joystick = pygame.joystick.Joystick(0)
- self.joystick.init()
-
- if self.joystick != None: "Joystick conectado"
- elif self.joystick == None: "Joystick desconectado"
-
-if __name__ == "__main__":
- zeus = Zeus()
- zeus.setup()
- zeus.Run()
diff --git a/activity/icon.svg b/activity/icon.svg
new file mode 100644
index 0000000..9a6ea7f
--- /dev/null
+++ b/activity/icon.svg
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="55"
+ height="55"
+ id="svg2">
+ <defs
+ id="defs4" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(0,-997.36218)"
+ id="layer1">
+ <g
+ transform="matrix(1,0,0,0.98625555,0,14.461592)"
+ id="g3779">
+ <path
+ d="M 1.6089109,50.029703 17.378853,34.721548 27.846535,1.2871287 36.772505,33.957601 53.341584,50.277228 z"
+ transform="translate(0,997.36218)"
+ id="path2985"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ d="m 5.6017208,1047.844 -2.7551862,3.7541 0.9724186,-0.4022 0.8103489,0.2682 1.7827677,-0.8045 1.458628,1.4748 1.7827675,-0.8044 -1.458628,-4.0223 z"
+ id="path2991"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ <path
+ d="m 43.163602,1047.8861 -2.755186,3.7541 0.972418,-0.4022 0.810349,0.2682 1.782768,-0.8045 1.458628,1.4748 1.782767,-0.8044 -1.458628,-4.0223 z"
+ id="path2991-0"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ </g>
+ </g>
+</svg>
diff --git a/nav.py b/nav.py
deleted file mode 100755
index 4a3a835..0000000
--- a/nav.py
+++ /dev/null
@@ -1,233 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# nav.py por:
-# Cristofer Travieso
-
-import os
-import sys
-import time
-import random
-import pygame
-from pygame.locals import *
-
-import variables
-import sprites_file
-
-os.system("clear")
-
-
-#tarea proxima:balas enemigas funcionen
-#self.NIVELes
-#ect
-
-class Nav():
- def __init__(self):
- self.ventana= None
- self.fondo= None
- self.reloj = None
- self.estado= None
- self.personaje= None
- self.sprites= None
- self.balas = None
- self.n = 0
- self.cronometro = 0
- self.bala1 = []
- self.bala2 = []
- self.mi_nave = None
- self.mis_naves = None
- self.cantidad_buum = 0
- self.pausa = False
- self.grupo_pausa = None
- self.naves_muertas = 0
- self.fuente = None
- self.NIVEL = 1
- self.limite = 25
-
- self.precargar()
- self.cargar()
- self.ejecutar()
-
-
- def precargar(self):
- pygame.init()
- pygame.font.init()
- pygame.display.set_mode(variables.RESOLUCION , pygame.FULLSCREEN, 0)
-
-
- def cargar(self):
- self.ventana = pygame.display.get_surface()
- self.fondo = pygame.transform.scale(pygame.image.load(os.path.join(variables.IMAGENES, "fondo.png")),variables.RESOLUCION)
- self.reloj = pygame.time.Clock()
- self.mis_naves = pygame.sprite.Group()
- self.sprites = pygame.sprite.OrderedUpdates()
- self.mi_nave = sprites_file.Mi_nave()
- self.sprites.add(self.mi_nave)
- self.mis_naves.add(self.mi_nave)
- self.naves_enemigas = pygame.sprite.Group()
- self.balas = pygame.sprite.Group()
- self.balas_enemigas = pygame.sprite.Group()
- self.fuente = pygame.font.Font(None, 48)
- #self.lluvia = 100
- #self.meteoritos = pygame.sprite.Group()
-
- #pygame.mixer.music.load(os.path.join(SONIDO, "Zeropage-Trance_Etude_2.mp3")) MP3 no sopórtado por pygame
- #pygame.mixer.music.play(-1,0)
-
- self.dialogo_Continuar = sprites_file.Continuar()
- self.dialogo_salir = sprites_file.Salir()
- self.dialogo_pausa = sprites_file.Pausa()
- self.dialogo_puntero = sprites_file.Puntero()
-
- pygame.mouse.set_visible(False)
-
- self.estado = True
- self.cronometro = 5 * self.NIVEL
-
-
- def ejecutar(self):
- self.ventana.blit(self.fondo, (0,0))
- pygame.display.update()
- while self.estado:
- self.reloj.tick(35)
- self.sprites.clear(self.ventana, self.fondo)
-
- if not self.pausa:
- self.sprites.update(self.cantidad_buum,self.sprites,self.balas_enemigas,self.NIVEL)
- else:
- self.dialogo_puntero.Actualizar()
- self.dialogo_Continuar.Actualizar(self.dialogo_puntero,self.Pausa)
- self.dialogo_salir.Actualizar(self.dialogo_puntero)
- self.dialogo_pausa.Actualizar()
-
- self.handle_event()
- pygame.event.clear()
- self.sprites.draw(self.ventana)
- pygame.display.update()
-
- if not self.pausa:
- self.Genera_enemigos()
-
- self.coliciones_mi_nave()
- self.coliciones_bala()
- self.coliciones_bala_enemigas_meteorito()
-
- if self.naves_muertas > self.limite:
-
- self.NIVEL += 1
- self.limite = self.limite * 2
- texto = self.fuente.render("Nivel "+str(self.NIVEL),0,(255,230,245))
- self.ventana.blit(texto,(variables.RESOLUCION[0]/2,variables.RESOLUCION[1]/2))
-
- #self.Lluvia()
-
- pygame.display.update()
-
-
- def Mostrar_Esconder(self):
- objetos=[self.dialogo_Continuar,self.dialogo_salir,self.dialogo_pausa,self.dialogo_puntero]
- for objeto in objetos:
- if objeto in self.sprites.sprites():
- objeto.Reniciate()
- else:self.sprites.add(objeto)
- '''if self.dialogo_pausa == None:
- self.dialogo_Continuar = sprites_file.Continuar()
- self.dialogo_salir = sprites_file.Salir()
- self.dialogo_pausa = sprites_file.Pausa()
- self.dialogo_puntero = sprites_file.Puntero()
- else:
- self.dialogo_Continuar = None
- self.dialogo_salir = None
- self.dialogo_pausa = None
- self.dialogo_puntero = None'''
-
-
- def coliciones_mi_nave(self):
- #colicion entre mi nave y enemigaspñ
- colicionados1 = pygame.sprite.groupcollide(self.mis_naves,self.naves_enemigas,False,False)
- try:
- for enemiga in colicionados1[self.mi_nave]:
- self.fin()
- except:pass
-
-
- def coliciones_bala(self):
- #colicion entre balas y enemigas
- colicionados2 = pygame.sprite.groupcollide(self.balas,self.naves_enemigas,False,False)
- for bala in colicionados2.keys():
- for obstaculo in colicionados2[bala]:
- self.sprites.add(sprites_file.Buum(obstaculo.rect.center))
- obstaculo.kill()
- bala.kill()
- self.naves_muertas += 1
-
-
- def coliciones_bala_enemigas_meteorito(self):
- if pygame.sprite.spritecollideany(self.mi_nave,self.balas_enemigas):
- self.fin()
- #if pygame.sprite.spritecollideany(self.mi_nave,self.meteoritos):
- # self.fin()
-
-
-
- def Genera_enemigos(self):
- if self.cronometro == 0:
- self.enemiga = sprites_file.Nave_enemiga(self.NIVEL)
- self.naves_enemigas.add(self.enemiga)
- self.sprites.add(self.enemiga)
- self.cronometro = 25*self.NIVEL
- else:self.cronometro -= 1
-
-
- def handle_event(self):
- for event in pygame.event.get(pygame.KEYDOWN):
- tecla= event.key
- if not self.pausa:
- if tecla == pygame.K_SPACE:
- self.bala1.append(sprites_file.Bala(self.mi_nave.rect.center,True))
- self.sprites.add(self.bala1[-1])
- self.balas.add(self.bala1[-1])
-
- self.bala2.append(sprites_file.Bala(self.mi_nave.rect.center,False))
- self.sprites.add(self.bala2[-1])
- self.balas.add(self.bala2[-1])
-
- if tecla == pygame.K_ESCAPE:
- self.Pausa()
- elif tecla == pygame.K_r:
- Galaxian()
-
-
- def Pausa(self):
- print "pause"
-
- self.Mostrar_Esconder()
- if self.pausa:self.pausa = False
- else:self.pausa = True
-
- def fin(self):
- print"fin"
- buum_fin = sprites_file.Buum_fin()
- self.sprites.add(buum_fin)
-
-
- def salir():
- print "Saliendo..."
- self.estado = False
- sys.exit()
-
-
- #def Lluvia(self):
- # if self.lluvia == 0:
- # a = sprites_file.Meteorito()
- # self.sprites.add(a)
- # self.meteoritos.add(a)
- # self.lluvia = random.randint( 100, 130)
- # else:self.lluvia -= 1
-
-#pygame.mouse.get_pressed(): retorna (button1,button2,button3)
-#pygame.mouse.get_pressed()[0]:retorna bool por click izquierdo
-#
-
-if __name__=="__main__":
- Nav()
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..530f97c
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+
+bundlebuilder.start()
diff --git a/space.py b/space.py
new file mode 100755
index 0000000..1164d36
--- /dev/null
+++ b/space.py
@@ -0,0 +1,239 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# space.py por:
+# Cristofer Travieso
+
+import os
+import sys
+import time
+import random
+import pygame
+from pygame.locals import *
+
+import variables
+import sprites_file
+
+os.system("clear")
+
+base = os.path.dirname(__file__)
+resolution = (1200, 900)
+images = os.path.join(BASE, "Imagenes")
+my_ship = ("mi_nave.png","mi_nave2.png")
+bullet = "bala.png"
+sonic = os.path.join(BASE, "Sonido")
+
+#tarea proxima:balas enemigas funcionen
+#self.leveles
+#ect
+
+class Space():
+ def __init__(self):
+ self.window= None
+ self.backgroud= None
+ self.clock = None
+ self.status= None
+ self.sprite = None
+ self.sprites= None
+ self.bullets = None
+ self.n = 0
+ self.cronometro = 0
+ self.bullet1 = []
+ self.bullet2 = []
+ self.my_ship = None
+ self.my_ships = None
+ self.cantidad_buum = 0
+ self.pause = False
+ self.pause_group = None
+ self.ship_kill = 0
+ self.font = None
+ self.level = 1
+ self.end = 25
+
+ self.precargar()
+ self.load()
+ self.ejecut()
+
+
+ def precargar(self):
+ pygame.init()
+ pygame.font.init()
+ pygame.display.set_mode(variables.RESOLUCION , pygame.FULLSCREEN, 0)
+
+
+ def load(self):
+ self.window = pygame.display.get_surface()
+ self.backgroud = pygame.transform.scale(pygame.image.load(os.path.join(variables.IMAGENES, "fondo.png")),variables.RESOLUCION)
+ self.clock = pygame.time.Clock()
+ self.my_ships = pygame.sprite.Group()
+ self.sprites = pygame.sprite.OrderedUpdates()
+ self.my_ship = sprites_file.Mi_nave()
+ self.sprites.add(self.my_ship)
+ self.my_ships .add(self.my_ship)
+ self.enemige_ship = pygame.sprite.Group()
+ self.bullets = pygame.sprite.Group()
+ self.balas_enemigas = pygame.sprite.Group()
+ self.font = pygame.font.Font(None, 48)
+ #self.lluvia = 100
+ #self.meteoritos = pygame.sprite.Group()
+
+ #pygame.mixer.music.load(os.path.join(SONIDO, "Zeropage-Trance_Etude_2.mp3")) MP3 no sopórtado por pygame
+ #pygame.mixer.music.play(-1,0)
+
+ self.dialogo_Continuar = sprites_file.Continuar()
+ self.dialogo_exit = sprites_file.Salir()
+ self.dialogo_pausa = sprites_file.the_pause()
+ self.dialogo_puntero = sprites_file.Puntero()
+
+ pygame.mouse.set_visible(False)
+
+ self.status = True
+ self.cronometro = 5 * self.level
+
+
+ def ejecut(self):
+ self.window.blit(self.backgroud, (0,0))
+ pygame.display.update()
+ while self.status:
+ self.clock.tick(35)
+ self.sprites.clear(self.window, self.backgroud)
+
+ if not self.pause:
+ self.sprites.update(self.cantidad_buum,self.sprites,self.balas_enemigas,self.level)
+ else:
+ self.dialogo_puntero.Actualizar()
+ self.dialogo_Continuar.Actualizar(self.dialogo_puntero,self.pause)
+ self.dialogo_exit.Actualizar(self.dialogo_puntero)
+ self.dialogo_pausa.Actualizar()
+
+ self.handle_event()
+ pygame.event.clear()
+ self.sprites.draw(self.window)
+ pygame.display.update()
+
+ if not self.pause:
+ self.Genera_enemigos()
+
+ self.colillion_mi_nave()
+ self.colillion_bala()
+ self.colillion_bala_enemigas_meteorito()
+
+ if self.ship_kill > self.end:
+
+ self.level += 1
+ self.end = self.end * 2
+ texto = self.font.render("Nivel "+str(self.level),0,(255,230,245))
+ self.window.blit(texto,(variables.RESOLUCION[0]/2,variables.RESOLUCION[1]/2))
+
+ #self.Lluvia()
+
+ pygame.display.update()
+
+
+ def show_hide(self):
+ objetos=[self.dialogo_Continuar,self.dialogo_exit,self.dialogo_pausa,self.dialogo_puntero]
+ for objeto in objetos:
+ if objeto in self.sprites.sprites():
+ objeto.Reniciate()
+ else:self.sprites.add(objeto)
+ '''if self.dialogo_pausa == None:
+ self.dialogo_Continuar = sprites_file.Continuar()
+ self.dialogo_exit = sprites_file.Salir()
+ self.dialogo_pausa = sprites_file.the_pause()
+ self.dialogo_puntero = sprites_file.Puntero()
+ else:
+ self.dialogo_Continuar = None
+ self.dialogo_exit = None
+ self.dialogo_pausa = None
+ self.dialogo_puntero = None'''
+
+
+ def colillion_my_ship(self):
+ #colicion entre mi nave y enemigaspñ
+ colicionados1 = pygame.sprite.groupcollide(self.my_ships ,self.enemige_ship,False,False)
+ try:
+ for enemiga in colicionados1[self.my_ship]:
+ self.the_end()
+ except:pass
+
+
+ def colillion_bullet(self):
+ #colicion entre balas y enemigas
+ colicionados2 = pygame.sprite.groupcollide(self.balas,self.enemige_ship,False,False)
+ for bala in colicionados2.keys():
+ for obstaculo in colicionados2[bala]:
+ self.sprites.add(sprites_file.Buum(obstaculo.rect.center))
+ obstaculo.kill()
+ bala.kill()
+ self.ship_kill += 1
+
+
+ def colillion_bala_enemigas_meteorito(self):
+ if pygame.sprite.spritecollideany(self.my_ship,self.balas_enemigas):
+ self.the_end()
+ #if pygame.sprite.spritecollideany(self.my_ship,self.meteoritos):
+ # self.the_end()
+
+
+
+ def Genera_enemigos(self):
+ if self.cronometro == 0:
+ self.enemiga = sprites_file.Nave_enemiga(self.level)
+ self.enemige_ship.add(self.enemiga)
+ self.sprites.add(self.enemiga)
+ self.cronometro = 25*self.level
+ else:self.cronometro -= 1
+
+
+ def handle_event(self):
+ for event in pygame.event.get(pygame.KEYDOWN):
+ tecla= event.key
+ if not self.pause:
+ if tecla == pygame.K_SPACE:
+ self.bala1.append(sprites_file.Bala(self.my_ship.rect.center,True))
+ self.sprites.add(self.bala1[-1])
+ self.balas.add(self.bala1[-1])
+
+ self.bala2.append(sprites_file.Bala(self.my_ship.rect.center,False))
+ self.sprites.add(self.bala2[-1])
+ self.balas.add(self.bala2[-1])
+
+ if tecla == pygame.K_ESCAPE:
+ self.pause()
+ elif tecla == pygame.K_r:
+ Galaxian()
+
+
+ def the_pause(self):
+ print "pause"
+
+ self.Mostrar_Esconder()
+ if self.pause:self.pause = False
+ else:self.pause = True
+
+ def the_end(self):
+ print"the_end"
+ buum_the_end = sprites_file.Buum_the_end()
+ self.sprites.add(buum_the_end)
+
+
+ def exit():
+ print "Saliendo..."
+ self.status = False
+ sys.exit()
+
+
+ #def Lluvia(self):
+ # if self.lluvia == 0:
+ # a = sprites_file.Meteorito()
+ # self.sprites.add(a)
+ # self.meteoritos.add(a)
+ # self.lluvia = random.randint( 100, 130)
+ # else:self.lluvia -= 1
+
+#pygame.mouse.get_pressed(): retorna (button1,button2,button3)
+#pygame.mouse.get_pressed()[0]:retorna bool por click izquierdo
+#
+
+if __name__=="__main__":
+ Space()
diff --git a/sprites_file.py b/sprites_file.py
index ad81986..e092ce6 100644
--- a/sprites_file.py
+++ b/sprites_file.py
@@ -1,25 +1,30 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# nav.py por:
-# Cristofer Travieso(cristhofert97@gmail.com)
+# sprites_file.py por:
+# Cristofer Travieso(cristhofert97@gmail.com)
import os
import sys
import pygame
import random
-import variables
from pygame.locals import *
+base = os.path.dirname(__file__)
+resolution = (1200, 900)
+images = os.path.join(BASE, "Imagenes")
+my_ship = ("mi_nave.png","mi_nave2.png")
+bullet = "bala.png"
+sonic = os.path.join(BASE, "Sonido")
#---------------------clases de sprites------------------------------
#------------------------------------------------------------------------------
-class Bala(pygame.sprite.Sprite):
+class Bullet(pygame.sprite.Sprite):
def __init__(self, center, posicion):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,\
- variables.BALA))
+ self.image = pygame.image.load(os.path.join(IMAGENES,\
+ BALA))
self.rect = self.image.get_rect()
self.rect.center = center
if posicion:
@@ -36,14 +41,14 @@ class Bala(pygame.sprite.Sprite):
class BalaEnemiga(pygame.sprite.Sprite):
def __init__(self, center):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,\
+ self.image = pygame.image.load(os.path.join(IMAGENES,\
"bala2.png"))
self.rect = self.image.get_rect()
self.rect.center = center
def update(self,data=None,grupo=None,balas=None,nivel=0):
self.rect.centery += 10
- if self.rect.centery > variables.RESOLUCION[1]:
+ if self.rect.centery > RESOLUCION[1]:
self.kill()
@@ -52,7 +57,7 @@ class Buum(pygame.sprite.Sprite):
def __init__(self, center):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,
+ self.image = pygame.image.load(os.path.join(IMAGENES,
"buum.png"))
self.rect = self.image.get_rect()
self.rect.center = center
@@ -69,11 +74,11 @@ class Buum(pygame.sprite.Sprite):
self.cronometro -= 1
-class Buum_fin(pygame.sprite.Sprite):
+class Boom_end(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,\
+ self.image = pygame.image.load(os.path.join(IMAGENES,\
"buum_final.png"))
self.rect = self.image.get_rect()
self.rect.move_ip(0,0)
@@ -86,54 +91,54 @@ class Buum_fin(pygame.sprite.Sprite):
#----------
-class Continuar(pygame.sprite.Sprite):
+class Continue(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.escala = (110,60)
- self.imagen = pygame.image.load(os.path.join(variables.IMAGENES,\
+ self.imagen = pygame.image.load(os.path.join(IMAGENES,\
"continuar.png"))
- self.imagen2 = pygame.image.load(os.path.join(variables.IMAGENES,\
+ self.imagen2 = pygame.image.load(os.path.join(IMAGENES,\
"continuar2.png"))
self.image = self.imagen.copy()
self.rect = self.image.get_rect()
- self.rect.center = (variables.RESOLUCION[0]/2,0)
+ self.rect.center = (RESOLUCION[0]/2,0)
- def Actualizar(self,puntero,pausa):
- self.Bajar()
+ def update(self,Cursor,Pause):
+ self.down()
- if pygame.sprite.collide_rect(puntero,self):
+ if pygame.sprite.collide_rect(Cursor,self):
self.image = self.imagen2.copy()
- if pygame.mouse.get_pressed()[0]:pausa()
+ if pygame.mouse.get_pressed()[0]:Pause()
else:
self.image = self.imagen.copy()
- def Bajar(self):
- if self.rect.centery < variables.RESOLUCION[1]/2:
+ def down(self):
+ if self.rect.centery < RESOLUCION[1]/2:
self.rect.centery += 10
- def Subir(self):
+ def up(self):
if self.rect.centery > 0:
self.rect.centery -= 10
- def Reniciate(self):
+ def restart(self):
self.rect.centery = 0
self.kill()
-class Mi_nave(pygame.sprite.Sprite):
+class My_ship(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
- self.imagen1 = pygame.image.load(os.path.join(variables.IMAGENES,\
- variables.MI_NAVE[0]))
- self.imagen2 = pygame.image.load(os.path.join(variables.IMAGENES,\
- variables.MI_NAVE[1]))
+ self.imagen1 = pygame.image.load(os.path.join(IMAGENES,\
+ MI_NAVE[0]))
+ self.imagen2 = pygame.image.load(os.path.join(IMAGENES,\
+ MI_NAVE[1]))
self.image = self.imagen1
self.rect = self.image.get_rect()
- self.rect.center = (variables.RESOLUCION[0]/2,variables.RESOLUCION[1]-150)
+ self.rect.center = (RESOLUCION[0]/2,RESOLUCION[1]-150)
self.cronometro = 6
self.vidas = 1
@@ -146,10 +151,10 @@ class Mi_nave(pygame.sprite.Sprite):
self.cronometro -= 1
else:self.cronometro -= 1
- self.Controles()
+ self.controls()
- def Controles(self):
+ def controls(self):
tecla = pygame.key.get_pressed()
if tecla[K_LEFT] or tecla[K_a]:
self.rect.centerx -= 10
@@ -162,11 +167,11 @@ class Mi_nave(pygame.sprite.Sprite):
if self.rect.left <= 0:
self.rect.centerx += 10
- if self.rect.right >= variables.RESOLUCION[0]:
+ if self.rect.right >= RESOLUCION[0]:
self.rect.centerx -= 10
if self.rect.top <= 0:
self.rect.centery += 10
- if self.rect.bottom >= variables.RESOLUCION[1]:
+ if self.rect.bottom >= RESOLUCION[1]:
self.rect.centery -= 10
@@ -175,24 +180,24 @@ class Nave_enemiga(pygame.sprite.Sprite):
def __init__(self, nivel):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,\
+ self.image = pygame.image.load(os.path.join(IMAGENES,\
"nave_enemiga.png"))
self.rect = self.image.get_rect()
- self.centrox = variables.RESOLUCION[0]/2 #random.randint(100,variables.RESOLUCION[0]-100)
+ self.centrox = RESOLUCION[0]/2 #random.randint(100,RESOLUCION[0]-100)
self.rect.center = (self.centrox,0)
self.cronometro = 10
self.cronometro_tiro = 75*nivel
self.verdadero = True
- self.velocidad_x = 10
+ self.speed_x = 10
def update(self,data=None,grupo=None,balas=None,nivel=0):
self.rect.centery += 5
- self.mover(self.centrox, 200)
- self.rect.centerx += self.velocidad_x
- #self.mover_x()
- if self.rect.top > variables.RESOLUCION[1]:
+ self.move(self.centrox, 200)
+ self.rect.centerx += self.speed_x
+ #self.move_x()
+ if self.rect.top > RESOLUCION[1]:
self.kill()
- elif self.rect.x > variables.RESOLUCION[0]:
+ elif self.rect.x > RESOLUCION[0]:
self.kill()
elif self.rect.left < 0:
self.kill()
@@ -206,95 +211,95 @@ class Nave_enemiga(pygame.sprite.Sprite):
self.cronometro_tiro -= 1
- def mover(self,x,ancho):
+ def move(self,x,ancho):
self.max = x + ancho
self.min = x - ancho
if self.rect.centerx < self.min:
- self.velocidad_x = 10
+ self.speed_x = 10
elif self.rect.centerx > self.max:
- self.velocidad_x = -10
+ self.speed_x = -10
-#-------------------------dialogo_pausa---------------------------------------------
+#-------------------------dialogo_Pause---------------------------------------------
-class Pausa(pygame.sprite.Sprite):
+class Pause(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
- self.imagen = pygame.image.load(os.path.join(variables.IMAGENES,\
- "pausa.png"))
+ self.imagen = pygame.image.load(os.path.join(IMAGENES,\
+ "Pause.png"))
self.image = self.imagen.copy()
self.rect = self.image.get_rect()
- self.rect.center = (variables.RESOLUCION[0]/2,0)
+ self.rect.center = (RESOLUCION[0]/2,0)
- def Actualizar(self):
- self.Bajar()
+ def update(self):
+ self.down()
- def Bajar(self):
- if self.rect.centery < variables.RESOLUCION[1]/2-100:
+ def down(self):
+ if self.rect.centery < RESOLUCION[1]/2-100:
self.rect.centery += 10
- def Subir(self):
+ def up(self):
if self.rect.centery > 0:
self.rect.centery -= 10
- def Reniciate(self):
+ def restart(self):
self.rect.centery = 0
self.kill()
#--------------
-class Puntero(pygame.sprite.Sprite):
+class Cursor(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,\
- "puntero.png"))
+ self.image = pygame.image.load(os.path.join(IMAGENES,\
+ "Cursor.png"))
self.rect = self.image.get_rect()
- def Actualizar(self):
+ def update(self):
self.rect.center = pygame.mouse.get_pos()
- def Reniciate(self):
+ def restart(self):
self.rect.centery = 0
self.kill()
#-----------------
-class Salir(pygame.sprite.Sprite):
+class Exit(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.escala = (110,60)
- self.imagen = pygame.image.load(os.path.join(variables.IMAGENES,\
- "salir.png"))
- self.imagen2 = pygame.image.load(os.path.join(variables.IMAGENES,\
- "salir2.png"))
+ self.imagen = pygame.image.load(os.path.join(IMAGENES,\
+ "Exit.png"))
+ self.imagen2 = pygame.image.load(os.path.join(IMAGENES,\
+ "Exit2.png"))
self.image = self.imagen.copy()
self.rect = self.image.get_rect()
- self.rect.center = (variables.RESOLUCION[0]/2,0)
+ self.rect.center = (RESOLUCION[0]/2,0)
- def Actualizar(self,puntero):
- self.Bajar()
+ def update(self,Cursor):
+ self.down()
- if pygame.sprite.collide_rect(puntero,self):
+ if pygame.sprite.collide_rect(Cursor,self):
self.image = self.imagen2.copy()
if pygame.mouse.get_pressed()[0]:sys.exit()
else:
self.image = self.imagen.copy()
- def Bajar(self):
- if self.rect.centery < variables.RESOLUCION[1]/2+100:
+ def down(self):
+ if self.rect.centery < RESOLUCION[1]/2+100:
self.rect.centery += 10
- def Subir(self):
+ def up(self):
if self.rect.centery > 0:
self.rect.centery -= 10
- def Reniciate(self):
+ def restart(self):
self.rect.centery = 0
self.kill()
#-----------------
@@ -302,12 +307,12 @@ class Salir(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(variables.IMAGENES,\
+ self.image = pygame.image.load(os.path.join(IMAGENES,\
"meteorito.png"))
self.rect = self.image.get_rect()
self.rect.centerx = random.randint( 0, 1200)
def update(self, data, grupo, balas, nivel):
self.rect.centery += 5
- if self.rect.top > variables.RESOLUCION[1]:
+ if self.rect.top > RESOLUCION[1]:
self.kill()'''
diff --git a/variables.py b/variables.py
deleted file mode 100644
index f9f8e43..0000000
--- a/variables.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# nav.py por:
-# Cristofer Travieso()
-
-import os
-import sys
-import time
-import random
-import pygame
-from pygame.locals import *
-
-
-BASE= os.path.dirname(__file__)
-RESOLUCION = (1200, 900)
-IMAGENES = os.path.join(BASE, "Imagenes")
-MI_NAVE = ("mi_nave.png","mi_nave2.png")
-BALA = "bala.png"
-SONIDO = os.path.join(BASE, "Sonido")
-