Пример #1
0
    def __init__(self):
        # load all our block images

        self.dirImagenes = os.path.join("imagenes", "citas")
        resource.set_images_path(self.dirImagenes)

        self.images = {
            0: resource.get_image("PlantaAgua-01.png"),
            1: resource.get_image("PlantaAgua_selec.png"),
            2: resource.get_image("PlantaAgua_01selec.png")
        }
Пример #2
0
    def __init__(self, imagen, centro, interseccion, poderosa):
        pygame.sprite.Sprite.__init__(self)
        self.image = imagen

        self.comida = False
        resource.set_images_path(os.path.join("imagenes", "verdad"))

        self.image2 = resource.get_image("moneda2.png")
        self.rect = self.image.get_rect()
        self.rect.center = centro
        self.interseccion = interseccion
        self.poderosa = poderosa
        self.startTime = None

        if poderosa:
            self.image = resource.get_image("StarBig_On.png")
            self.image3 = self.image
            self.rect = self.image.get_rect()
            self.rect.center = centro
Пример #3
0
    def __init__(self,screen,cursor, clock, padre):
        resource.set_images_path(os.path.join("imagenes", "compartir"))
        self.background = resource.get_image("fondoCompartir.png")
        
        imgBtnEnviar = resource.get_image("botonEnviar.png")
        imgBtnEnviarSelec = resource.get_image("BotonesEnviar_selec.png")
        
        self.btnEnviar = Boton.Boton(imgBtnEnviar, imgBtnEnviarSelec, 700,550)
        
        
        
        self.screen = screen
        self.clock = clock
        self.tablero = padre

        self.mouse = mouse.Mouse()
        self.cursor = cursor
  
        self.inicio = True
        self.juego = False
        self.terminar = False
        self.envio = False
        self.letreroEnvio = False
        self.letreroNoEnvio = False
        self.CamposVacios = False
        

        self.tb1 = TextBox(position=(460,250),size=(400,25),textsize=22,editable=False)
        self.tb2 = TextBox(position=(460,300),size=(400,25),textsize=22,editable=False)
        self.contendora = textBox2.Contenedora()
        rutaFuente = os.path.join("fuentes", "PatrickHand-Regular.ttf")
        self.font = pygame.font.Font(rutaFuente, 22) 
        self.img=self.font.render("Nombre: ",1,(0,0,0))
        self.img2=self.font.render("Colegio: ",1,(0,0,0))
        self.img3=self.font.render("Mensaje: ",1,(0,0,0))
        
        
        resource.set_images_path(os.path.join("imagenes"))
        imgBtnRegresar = resource.get_image("boton_regresar.png")
        imgBtnRegresarSelec = resource.get_image("boton_regresar_selec.png")
        
        self.background2 = resource.get_image("Fondo.jpg", False)
        
        
        
        self.btnRegresar = Boton.Boton(imgBtnRegresar, imgBtnRegresarSelec, (1200 - 214 - 10), 10)
        
        self.msjInicio = MensajeEmergente.MensajeInicial(30, "Compartir")
        self.msjVacios = MensajeEmergente.MensajeInicial(30, "Compartir2")
        self.msjNoEnvio = MensajeEmergente.MensajeInicial(30, "Compartir3")
        self.msjEnvio = MensajeEmergente.MensajeInicial(30, "Compartir4")
Пример #4
0
    def __init__(self, cursor, screen, clock, padre):
        self.cursor = cursor
        bif = os.path.join("imagenes", "verdad")
        resource.set_images_path(bif)
        self.background = resource.get_image("fondoPacman.png", False)

        self.estrella = resource.get_image("star.png", False)

        self.screen = screen
        self.clock = clock

        self.tablero = padre

        self.audio = Servicios.cargarSonido("verdad.ogg",
                                            os.path.join("audios", "cuentos"))

        self.inicioPoderoso = None

        # self.cita = fraseVerdad.FraseVerdad(self.screen, self.clock, self.cursor, self.tablero)

        self.mouse = Cursor.Mouse()
        #self.botonReintentar = Boton.BotonReintentar()
        #self.botonContinuar = Boton.BotonContinuar()
        #self.botonTerminar = Boton.BotonTerminar()

        self.msjInicio = MensajeEmergente.MensajeInicial(30, "CuentoVerdad")
        self.msjGanaste = MensajeEmergente.MensajeGanaste(28, "JuegoVerdad")
        self.msjPerdiste = MensajeEmergente.MensajePerdiste(28, "JuegoVerdad")

        # self.instrucciones = pygame.image.load(os.path.join("imagenes", "verdad", "inicioVerdad.png")).convert_alpha()
        # self.letrero = pygame.image.load(os.path.join("imagenes", "verdad", "ganastePacman.png")).convert_alpha()
        #self.letreroReintento = resource.get_image("perdistePacman.png")).convert_alpha()

        self.inicio = True
        self.juego = False
        self.terminar = False
        self.gano = False
        self.perdio = False
        self.numMonedas = 0

        self.personaje = Personaje.PersonajePacman((0, 0),
                                                   self.tablero.personaje.sexo)

        self.loadSprites()

        self.monstruos = pygame.sprite.Group()
        monstruo1V = monstruo1.Monstruo1()
        self.monstruos.add(monstruo1V)
        monstruo2V = monstruo2.Monstruo2()
        self.monstruos.add(monstruo2V)
        monstruo3V = monstruo3.Monstruo3()
        self.monstruos.add(monstruo3V)

        self.bloques.draw(self.background)

        resource.set_images_path(os.path.join("imagenes"))
        imgBtnRegresar = resource.get_image("boton_regresar.png")
        imgBtnRegresarSelec = resource.get_image("boton_regresar_selec.png")

        self.btnRegresar = Boton.Boton(imgBtnRegresar, imgBtnRegresarSelec,
                                       (1200 - 214 - 10), 10)
Пример #5
0
    def run(self):
        
        if self.intro:
            self.sonido.stop()
            self.audio.play()
          
        self.xSelector = 0
        self.ySelector = -200
        
        resource.set_images_path(self.dirImagenes)
        # imgBtnSilencio = Servicios.cargarImagen("icono_silencio.png", self.dirImagenes)
        # imgBtnSilencioSelec = Servicios.cargarImagen("icono_silencio_selec.png", self.dirImagenes)
        imgBtnSilencio = resource.get_image("icono_silencio.png")
        imgBtnSilencioSelec = resource.get_image("icono_silencio_selec.png")
        self.btnSilencio = Boton.Boton(imgBtnSilencio, imgBtnSilencioSelec, self.xSelector, self.ySelector)
        
        imgBtnSilencioGris = resource.get_image("icono_silencio_gris.png")
        self.btnSilencioGris = Boton.Boton(imgBtnSilencioGris, imgBtnSilencioSelec, self.xSelector, self.ySelector)
        
        # imgBtnCuento = Servicios.cargarImagen("icono_cuento.png", self.dirImagenes)
        # imgBtnCuentoSelec = Servicios.cargarImagen("icono_cuento_selec.png", self.dirImagenes)
        imgBtnCuento = resource.get_image("icono_cuento.png")
        imgBtnCuentoSelec = resource.get_image("icono_cuento_selec.png")
        self.btnCuento = Boton.Boton(imgBtnCuento, imgBtnCuentoSelec, self.xSelector + 65, self.ySelector)
        
        imgBtnCuentoGris = resource.get_image("icono_cuento_gris.png")
        self.btnCuentoGris = Boton.Boton(imgBtnCuentoGris, imgBtnCuentoSelec, self.xSelector + 65, self.ySelector)
        
        # imgBtnCita = Servicios.cargarImagen("icono_cita.png", self.dirImagenes)
        # imgBtnCitaSelec = Servicios.cargarImagen("icono_cita_selec.png", self.dirImagenes)
        imgBtnCita = resource.get_image("icono_cita.png")
        imgBtnCitaSelec = resource.get_image("icono_cita_selec.png")
        self.btnCita = Boton.Boton(imgBtnCita, imgBtnCitaSelec, self.xSelector, self.ySelector + 65)
        
        imgBtnCitaGris = resource.get_image("icono_cita_gris.png")
        self.btnCitaGris = Boton.Boton(imgBtnCitaGris, imgBtnCitaSelec, self.xSelector, self.ySelector + 65)
        
        # imgBtnCanto = Servicios.cargarImagen("icono_canto.png", self.dirImagenes)
        # imgBtnCantoSelec = Servicios.cargarImagen("icono_canto_selec.png", self.dirImagenes)
        imgBtnCanto = resource.get_image("icono_canto.png")
        imgBtnCantoSelec = resource.get_image("icono_canto_selec.png")
        self.btnCanto = Boton.Boton(imgBtnCanto, imgBtnCantoSelec, self.xSelector + 65, self.ySelector + 65) 
        
        imgBtnCantoGris = resource.get_image("icono_canto_gris.png")
        self.btnCantoGris = Boton.Boton(imgBtnCantoGris, imgBtnCantoSelec, self.xSelector + 65, self.ySelector + 65) 
        
        if self.mandala is None:
            self.mandala = VentanaMandala.VentanaMandala(self.cursor, self.screen, self.clock, self.ancho, self.alto, "Flor", self)
        
        resource.set_images_path(os.path.join("imagenes"))
        # fondo = Servicios.cargarImagen("Fondo.jpg", os.path.join("imagenes"))
        fondo = resource.get_image("Fondo.jpg")
        
        x = self.ancho - (self.ancho / 2) - (self.background.get_width() / 2)
        y = self.alto - (self.alto / 2) - (self.background.get_height() / 2)
        
        fuenteTitulo = pygame.font.SysFont("helvetica", 30, True)
        
        textoNombre = self.fuenteGrande.render("Bienvenido(a) %s" % (self.personaje.nombre), 1, (255, 255, 255))
        textoInfo = self.fuenteGrande.render("Selecciona un valor presionando uno de los iconos", 1, (255, 255, 255))
        
        selectorAmor = False
        selectorRectitud = False
        selectorPaz = False
        selectorVerdad = False
        selectorNoViolencia = False
        
        valorSelector = ""
        
        #=======================================================================
        # print self.pasoSilencioAmor
        # print self.pasoCuentoAmor
        # print self.pasoCitaAmor
        # print self.pasoCantoAmor
        #=======================================================================
        
        self.pasoAmor = self.pasoSilencioAmor and self.pasoCuentoAmor and self.pasoCitaAmor and self.pasoCantoAmor
        self.pasoRectitud = self.pasoSilencioRectitud and self.pasoCuentoRectitud and self.pasoCitaRectitud and self.pasoCantoRectitud
        self.pasoPaz = self.pasoSilencioPaz and self.pasoCuentoPaz and self.pasoCitaPaz and self.pasoCantoPaz
        self.pasoVerdad = self.pasoSilencioVerdad and self.pasoCuentoVerdad and self.pasoCitaVerdad and self.pasoCantoVerdad
        self.pasoNoViolencia = self.pasoSilencioNoViolencia and self.pasoCuentoNoViolencia and self.pasoCitaNoViolencia and self.pasoCantoNoViolencia
        
        salir = False
        
        while salir == False:
            for event in pygame.event.get():
                if event.type == QUIT:
                    pygame.quit()
                    sys.exit()
                            
                if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:
                    
                    if self.cursor.colliderect(self.btnRegresar.rect):
                        salir = True 
                        self.menu.run()
                    if self.cursor.colliderect(self.msjInicio.btn.rect):
                        self.msjInicio.visible = False
                        self.audio.stop()
                        self.sonido.play(-1)
                        self.intro = False
# SILENCIO            
                    if self.cursor.colliderect(self.btnSilencioGris.rect) or self.cursor.colliderect(self.btnSilencio.rect):
                        
                        if valorSelector == "amor":
                            salir = True
                            self.sonido.stop()
                            self.mandala.setTipo("Flor")
                            self.mandala.run()
                            
                        if valorSelector == "rectitud":
                                salir = True
                                self.sonido.stop()
                                self.mandala.setTipo("Sol")
                                self.mandala.run()
                        
                        if valorSelector == "paz":
                                salir = True
                                self.sonido.stop()
                                self.mandala.setTipo("Hojas")
                                self.mandala.run()
                                
                        if valorSelector == "verdad":
                                salir = True
                                self.sonido.stop()
                                self.mandala.setTipo("Nino")
                                self.mandala.run()
                                
                        if valorSelector == "noviolencia":
                                salir = True
                                self.sonido.stop()
                                self.mandala.setTipo("Flor2")
                                self.mandala.run()
# CUENTO                               
                    if self.cursor.colliderect(self.btnCuentoGris.rect) or self.cursor.colliderect(self.btnCuento.rect):
                        
                        if valorSelector == "amor":
                            salir = True
                            self.sonido.stop()
                            self.cuento = Amor.Amor(self.cursor, self.screen, self.clock, self)
                            self.cuento.run()
                            
                        if valorSelector == "rectitud":
                                salir = True
                                self.sonido.stop()
                                self.cuento = Rectitud.Rectitud(self.cursor, self.screen, self.clock, self)
                                self.cuento.run()
                        
                        if valorSelector == "paz":
                                salir = True
                                self.sonido.stop()
                                self.cuento = pazSemillas.PazSemillas(self.cursor, self.screen, self.clock, self)
                                self.cuento.run()
                                
                        if valorSelector == "verdad":
                                salir = True
                                self.sonido.stop()
                                self.cuento = pacman.Pacman(self.cursor, self.screen, self.clock, self)
                                self.cuento.run()
                                
                        if valorSelector == "noviolencia":
                                salir = True
                                self.sonido.stop()
                                self.cuento = puzzle.Puzzle(self.cursor, self.screen, self.clock, self)
                                self.cuento.run()
# CITA                                
                    if self.cursor.colliderect(self.btnCitaGris.rect) or self.cursor.colliderect(self.btnCita.rect):
                        
                        if valorSelector == "amor":
                            salir = True
                            self.sonido.stop()
                            if self.cita is None :
                                self.cita = Cita.Cita(self.screen, self.clock, self.cursor, 1, self)
                            self.cita.setTipo(1)
                            self.cita.run()
                            
                        if valorSelector == "rectitud":
                                salir = True
                                self.sonido.stop()
                                if self.cita is None :
                                    self.cita = Cita.Cita(self.screen, self.clock, self.cursor, 2, self)
                                self.cita.setTipo(2)
                                self.cita.run()
                        
                        if valorSelector == "paz":
                                salir = True
                                self.sonido.stop()
                                if self.cita is None :
                                    self.cita = Cita.Cita(self.screen, self.clock, self.cursor, 3, self)
                                self.cita.setTipo(3)
                                self.cita.run()
                                
                        if valorSelector == "verdad":
                                salir = True
                                self.sonido.stop()
                                if self.cita is None :
                                    self.cita = Cita.Cita(self.screen, self.clock, self.cursor, 4, self)
                                self.cita.setTipo(4)
                                self.cita.run()
                                
                        if valorSelector == "noviolencia":
                                salir = True
                                self.sonido.stop()
                                if self.cita is None :
                                    self.cita = Cita.Cita(self.screen, self.clock, self.cursor, 5, self)
                                self.cita.setTipo(5)
                                self.cita.run()
# CANTO                    
                    if self.cursor.colliderect(self.btnCantoGris.rect) or self.cursor.colliderect(self.btnCanto.rect):
                        
                        if valorSelector == "amor":
                            salir = True
                            self.sonido.stop()
                            self.canto = Karaoke.Karaoke(self.cursor, self.screen, self.clock, 1, self)
                            self.canto.run()
                            
                        if valorSelector == "rectitud":
                                salir = True
                                self.sonido.stop()
                                self.canto = Karaoke.Karaoke(self.cursor, self.screen, self.clock, 2, self)
                                self.canto.run()
                        
                        if valorSelector == "paz":
                                salir = True
                                self.sonido.stop()
                                self.canto = Karaoke.Karaoke(self.cursor, self.screen, self.clock, 3, self)
                                self.canto.run()
                                
                        if valorSelector == "verdad":
                                salir = True
                                self.sonido.stop()
                                self.canto = Karaoke.Karaoke(self.cursor, self.screen, self.clock, 4, self)
                                self.canto.run()
                                
                        if valorSelector == "noviolencia":
                                salir = True
                                self.sonido.stop()
                                self.canto = Karaoke.Karaoke(self.cursor, self.screen, self.clock, 5, self)
                                self.canto.run()

                    if self.cursor.colliderect(self.areaAmor):
                        print "Click en amor"
                        
                        self.sonido2 = self.sonidoAmor
                        # self.sonido2 = Servicios.cargarSonido("amor_instrum.ogg", os.path.join("audios"))
                        
                        valorSelector = "amor"
                        
                        self.xSelector = 658 + 10
                        self.ySelector = 523 + 15
                        
                        if self.pasoSilencioAmor:
                            self.btnSilencio.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencioGris.setCoord(0, -200)
                        else:
                            self.btnSilencioGris.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencio.setCoord(0, -200)
                        
                        if self.pasoCuentoAmor:
                            self.btnCuento.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuentoGris.setCoord(0, -200)
                        else:
                            self.btnCuentoGris.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuento.setCoord(0, -200)
                        if self.pasoCitaAmor:
                            self.btnCita.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCitaGris.setCoord(0, -200)
                        else:
                            self.btnCitaGris.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCita.setCoord(0, -200)
                        if self.pasoCantoAmor:
                            self.btnCanto.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCantoGris.setCoord(0, -200)
                        else:
                            self.btnCantoGris.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCanto.setCoord(0, -200)
                        # salir = True
                        # self.sonido.stop()
                        # self.mandala.setTipo("Flor")
                        # self.mandala.run()
                        
                    
                    if self.cursor.colliderect(self.areaRectitud):
                        print "Click en rectitud"
                        
  #------                      if self.pasoAmor:
                        
                        self.sonido2 = self.sonidoRectitud
                        # self.sonido2 = Servicios.cargarSonido("rectitud_instrum.ogg", os.path.join("audios"))
                        
                        valorSelector = "rectitud"
                                
                        self.xSelector = 743 + 10
                        self.ySelector = 275 + 15
                                
                        if self.pasoSilencioRectitud:
                            self.btnSilencio.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencioGris.setCoord(0, -200)
                        else:
                            self.btnSilencioGris.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencio.setCoord(0, -200)
                        
                        if self.pasoCuentoRectitud:
                            self.btnCuento.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuentoGris.setCoord(0, -200)
                        else:
                            self.btnCuentoGris.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuento.setCoord(0, -200)
                        if self.pasoCitaRectitud:
                            self.btnCita.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCitaGris.setCoord(0, -200)
                        else:
                            self.btnCitaGris.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCita.setCoord(0, -200)
                        if self.pasoCantoRectitud:
                            self.btnCanto.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCantoGris.setCoord(0, -200)
                        else:
                            self.btnCantoGris.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCanto.setCoord(0, -200)
                            
                            # if self.pasoAmor:
                            # self.mandala.setTipo("Sol")
                            # self.sonido.stop()
                            # salir = True
                            # self.mandala.run()
                            
                    if self.cursor.colliderect(self.areaPaz):
                        print "Click en paz"
                        
  #------                      if self.pasoRectitud:
                        
                        self.sonido2 = self.sonidoPaz
                        # self.sonido2 = Servicios.cargarSonido("paz_instrum.ogg", os.path.join("audios"))
                        
                        valorSelector = "paz"
                                
                        self.xSelector = 531 + 10
                        self.ySelector = 118 
                                
                        if self.pasoSilencioPaz:
                            self.btnSilencio.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencioGris.setCoord(0, -200)
                        else:
                            self.btnSilencioGris.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencio.setCoord(0, -200)
                        
                        if self.pasoCuentoPaz:
                            self.btnCuento.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuentoGris.setCoord(0, -200)
                        else:
                            self.btnCuentoGris.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuento.setCoord(0, -200)
                        if self.pasoCitaPaz:
                            self.btnCita.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCitaGris.setCoord(0, -200)
                        else:
                            self.btnCitaGris.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCita.setCoord(0, -200)
                        if self.pasoCantoPaz:
                            self.btnCanto.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCantoGris.setCoord(0, -200)
                        else:
                            self.btnCantoGris.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCanto.setCoord(0, -200)
                            # if self.pasoRectitud:
                            # self.mandala.setTipo("Hojas")
                            # salir = True
                            # self.sonido.stop()
                            # self.mandala.run()
                            
                    if self.cursor.colliderect(self.areaVerdad):
                        print "Click en verdad"
                        
  #------                      if self.pasoPaz:
                        
                        self.sonido2 = self.sonidoVerdad
                        # self.sonido2 = Servicios.cargarSonido("noViolencia_instrum.ogg", os.path.join("audios"))
                        
                        valorSelector = "verdad"
                                
                        self.xSelector = 316 + 10
                        self.ySelector = 275 + 15
                                
                        if self.pasoSilencioVerdad:
                            self.btnSilencio.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencioGris.setCoord(0, -200)
                        else:
                            self.btnSilencioGris.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencio.setCoord(0, -200)
                        
                        if self.pasoCuentoVerdad:
                            self.btnCuento.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuentoGris.setCoord(0, -200)
                        else:
                            self.btnCuentoGris.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuento.setCoord(0, -200)
                        if self.pasoCitaVerdad:
                            self.btnCita.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCitaGris.setCoord(0, -200)
                        else:
                            self.btnCitaGris.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCita.setCoord(0, -200)
                        if self.pasoCantoVerdad:
                            self.btnCanto.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCantoGris.setCoord(0, -200)
                        else:
                            self.btnCantoGris.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCanto.setCoord(0, -200)
                            # if self.pasoPaz:
                            # self.mandala.setTipo("Nino")
                            # self.sonido.stop()
                            # salir = True
                            # self.mandala.run()
                    
                    if self.cursor.colliderect(self.areaNoViolencia):
                        print "Click en No violencia"
                        
  #------                      if self.pasoVerdad:
                        
                        self.sonido2 = self.sonidoNoViolencia
                        # self.sonido2 = Servicios.cargarSonido("noViolencia_instrum.ogg", os.path.join("audios"))
                        
                        valorSelector = "noviolencia"
                            
                        self.xSelector = 397 + 10
                        self.ySelector = 523 + 15
                                
                        if self.pasoSilencioNoViolencia:
                            self.btnSilencio.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencioGris.setCoord(0, -200)
                        else:
                            self.btnSilencioGris.setCoord(self.xSelector, self.ySelector)
                            self.btnSilencio.setCoord(0, -200)
                        
                        if self.pasoCuentoNoViolencia:
                            self.btnCuento.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuentoGris.setCoord(0, -200)
                        else:
                            self.btnCuentoGris.setCoord(self.xSelector + 65, self.ySelector)
                            self.btnCuento.setCoord(0, -200)
                        if self.pasoCitaNoViolencia:
                            self.btnCita.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCitaGris.setCoord(0, -200)
                        else:
                            self.btnCitaGris.setCoord(self.xSelector, self.ySelector + 65)
                            self.btnCita.setCoord(0, -200)
                        if self.pasoCantoNoViolencia:
                            self.btnCanto.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCantoGris.setCoord(0, -200)
                        else:
                            self.btnCantoGris.setCoord(self.xSelector + 65, self.ySelector + 65)
                            self.btnCanto.setCoord(0, -200)
                            # if self.pasoVerdad:
                            # self.mandala.setTipo("Flor2")
                            # self.sonido.stop()
                            # salir = True
                            # self.mandala.run()
                        
                    print valorSelector
                    
            
            self.clock.tick(60)
            
            self.cursor.update()
            
            self.screen.blit(fondo, (0, 0))
            
            self.screen.blit(self.background, (x, y))
            
            valorElegido = ""
            
            self.btnRegresar.update(self.screen, self.cursor)
            
            self.msjInicio.update(self.screen, self.cursor)
            
            if self.intro:
                self.msjInicio.visible = True
                #self.btnRegresar.update(self.screen, self.cursor)
            else:
                
                if self.pasoAmor:
                    self.screen.blit(self.imagenAmor, (x, y))
                # else:
                    # self.screen.blit(self.candadoRectitud, (x, y))
                    
                if self.pasoRectitud:
                    self.screen.blit(self.imagenRectitud, (x, y))
                # else:
                    # self.screen.blit(self.candadoPaz, (x, y))
                
                if self.pasoPaz:
                    self.screen.blit(self.imagenPaz, (x, y))
                # else:
                    # self.screen.blit(self.candadoVerdad, (x, y))
                    
                if self.pasoVerdad:
                    self.screen.blit(self.imagenVerdad, (x, y))
                # else:
                    # self.screen.blit(self.candadoNoViolencia, (x, y))
                    
                if self.pasoNoViolencia:
                    self.screen.blit(self.imagenNoViolencia, (x, y))
                    
                    
                
                
                if self.cursor.colliderect(self.areaAmor):
                    valorElegido = "    AMOR    "
                    self.screen.blit(self.imagenAmorSel, (x, y))
                    
                if self.cursor.colliderect(self.areaRectitud):
                    valorElegido = "  RECTITUD  "
                    self.screen.blit(self.imagenRectitudSel, (x, y))
                    if not self.pasoAmor:
                        self.screen.blit(self.candadoRectitud, (x, y))
                        
                if self.cursor.colliderect(self.areaPaz):
                    valorElegido = "     PAZ    "
                    self.screen.blit(self.imagenPazSel, (x, y))
                    if not self.pasoRectitud:
                        self.screen.blit(self.candadoPaz, (x, y))
                    
                if self.cursor.colliderect(self.areaVerdad):
                    valorElegido = "   VERDAD   "
                    self.screen.blit(self.imagenVerdadSel, (x, y))
                    if not self.pasoPaz:
                        self.screen.blit(self.candadoVerdad, (x, y))
                    
                if self.cursor.colliderect(self.areaNoViolencia):
                    valorElegido = "NO VIOLENCIA"
                    self.screen.blit(self.imagenNoViolenciaSel, (x, y))
                    if not self.pasoVerdad:
                        self.screen.blit(self.candadoNoViolencia, (x, y))
                
                
                self.btnSilencio.update(self.screen, self.cursor)
                self.btnSilencioGris.update(self.screen, self.cursor)
                self.btnCuento.update(self.screen, self.cursor)
                self.btnCuentoGris.update(self.screen, self.cursor)
                self.btnCita.update(self.screen, self.cursor)
                self.btnCitaGris.update(self.screen, self.cursor)
                self.btnCanto.update(self.screen, self.cursor)
                self.btnCantoGris.update(self.screen, self.cursor)
                
                
                textoValor = fuenteTitulo.render(valorElegido, 1, (255, 255, 255))
                self.screen.blit(textoValor, (530, 770))
                
                self.screen.blit(textoNombre, (10, 3))
                self.screen.blit(textoInfo, (10, 33))
                
                #===================================================================
                # pygame.draw.rect (self.screen , (100, 100, 100) , self.areaPaz, 2)
                # pygame.draw.rect (self.screen , (100, 100, 100) , self.areaRectitud, 2)
                # pygame.draw.rect (self.screen , (100, 100, 100) , self.areaAmor, 2)
                # pygame.draw.rect (self.screen , (100, 100, 100) , self.areaNoViolencia, 2)
                # pygame.draw.rect (self.screen , (100, 100, 100) , self.areaVerdad, 2)
                #===================================================================

            pygame.display.update()
Пример #6
0
    def __init__(self, ventPadre, cursor, screen, clock, anchoVentana, altoVentana):
        
        self.compartir = compartir.Compartir(screen, cursor, clock, self)
        
        self.menu = ventPadre
        
        self.ancho = anchoVentana
        self.alto = altoVentana
        
        self.msjInicio = MensajeEmergente.MensajeInicial(40, "Tablero")
        
        self.personaje = self.menu.personaje
        
        self.mandala = None
        self.cuento = None
        self.cita = None
        self.canto = None

        self.sonido = self.menu.musicaMenu
        
        self.audio = Servicios.cargarSonido("intro.ogg", os.path.join("audios", "cuentos"))
        
        # cargo a memoria los audios
        resource.set_sounds_path(os.path.join("audios"))
        self.sonidoAmor = resource.get_sound("amor_instrum.ogg")
        self.sonidoRectitud = resource.get_sound("rectitud_instrum.ogg")
        self.sonidoPaz = resource.get_sound("paz_instrum.ogg")
        self.sonidoVerdad = resource.get_sound("verdad_instrum.ogg")
        self.sonidoNoViolencia = resource.get_sound("noViolencia_instrum.ogg")
        # self.sonido2=resource.get_sound("verdad_instrum.ogg")
        self.sonido2 = None
        
        
        # self.sonidoExito = Servicios.cargarSonido("exito.wav", "audios")
        self.sonidoExito = resource.get_sound("exito.wav")
        
        self.dirImagenes = os.path.join("imagenes", "tableroCentral")
        
        resource.set_images_path(self.dirImagenes)
        
        # self.background = Servicios.cargarImagen("Mandala_Tablero_Blanco.png", self.dirImagenes)
        # self.imagenPaz = Servicios.cargarImagen("Mandala_Tablero_Paz.png", self.dirImagenes)
        # self.imagenPazSel = Servicios.cargarImagen("Mandala_Tablero_Paz_Seleccionado.png", self.dirImagenes)
        # self.imagenAmor = Servicios.cargarImagen("Mandala_Tablero_Amor.png", self.dirImagenes)
        # self.imagenAmorSel = Servicios.cargarImagen("Mandala_Tablero_Amor_Seleccionado.png", self.dirImagenes)
        # self.imagenRectitud = Servicios.cargarImagen("Mandala_Tablero_Rectitud.png", self.dirImagenes)
        # self.imagenRectitudSel = Servicios.cargarImagen("Mandala_Tablero_Rectitud_Seleccionado.png", self.dirImagenes)
        # self.imagenVerdad = Servicios.cargarImagen("Mandala_Tablero_Verdad.png", self.dirImagenes)
        # self.imagenVerdadSel = Servicios.cargarImagen("Mandala_Tablero_Verdad_Seleccionado.png", self.dirImagenes)
        # self.imagenNoViolencia = Servicios.cargarImagen("Mandala_Tablero_NoViolencia.png", self.dirImagenes)
        # self.imagenNoViolenciaSel = Servicios.cargarImagen("Mandala_Tablero_NoViolencia_Seleccionado.png", self.dirImagenes)
        # self.candadoRectitud = Servicios.cargarImagen("candado_rectitud.png", self.dirImagenes)
        # self.candadoPaz = Servicios.cargarImagen("candado_paz.png", self.dirImagenes)
        # self.candadoVerdad = Servicios.cargarImagen("candado_verdad.png", self.dirImagenes)
        # self.candadoNoViolencia = Servicios.cargarImagen("candado_noviolencia.png", self.dirImagenes)
        
        self.background = resource.get_image("Mandala_Tablero_Blanco.png")
        self.imagenPaz = resource.get_image("Mandala_Tablero_Paz.png")
        self.imagenPazSel = resource.get_image("Mandala_Tablero_Paz_Seleccionado.png")
        self.imagenAmor = resource.get_image("Mandala_Tablero_Amor.png")
        self.imagenAmorSel = resource.get_image("Mandala_Tablero_Amor_Seleccionado.png")
        self.imagenRectitud = resource.get_image("Mandala_Tablero_Rectitud.png")
        self.imagenRectitudSel = resource.get_image("Mandala_Tablero_Rectitud_Seleccionado.png")
        self.imagenVerdad = resource.get_image("Mandala_Tablero_Verdad.png")
        self.imagenVerdadSel = resource.get_image("Mandala_Tablero_Verdad_Seleccionado.png")
        self.imagenNoViolencia = resource.get_image("Mandala_Tablero_NoViolencia.png")
        self.imagenNoViolenciaSel = resource.get_image("Mandala_Tablero_NoViolencia_Seleccionado.png")
        self.candadoRectitud = resource.get_image("candado_rectitud.png")
        self.candadoPaz = resource.get_image("candado_paz.png")
        self.candadoVerdad = resource.get_image("candado_verdad.png")
        self.candadoNoViolencia = resource.get_image("candado_noviolencia.png")
        
        self.cursor = cursor
        self.screen = screen
        self.clock = clock
        
        self.pasoSilencioAmor = False
        self.pasoCuentoAmor = False
        self.pasoCitaAmor = False
        self.pasoCantoAmor = False
        self.pasoAmor = False
        
        self.pasoSilencioRectitud = False
        self.pasoCuentoRectitud = False
        self.pasoCitaRectitud = False
        self.pasoCantoRectitud = False
        self.pasoRectitud = False
        
        self.pasoSilencioPaz = False
        self.pasoCuentoPaz = False
        self.pasoCitaPaz = False
        self.pasoCantoPaz = False
        self.pasoPaz = False
        
        self.pasoSilencioVerdad = False
        self.pasoCuentoVerdad = False
        self.pasoCitaVerdad = False
        self.pasoCantoVerdad = False
        self.pasoVerdad = False
        
        self.pasoSilencioNoViolencia = False
        self.pasoCuentoNoViolencia = False
        self.pasoCitaNoViolencia = False
        self.pasoCantoNoViolencia = False
        self.pasoNoViolencia = False
        
        sumarAX = 100
        sumarAY = 63
        
        x = 431 + sumarAX
        y = 50 + 5 + sumarAY
        anch = 141
        alt = 141
        self.areaPaz = Rect(x, y, anch, alt) 
        
        x = 643 + sumarAX
        y = 197 + 15 + sumarAY
        anch = 141
        alt = 141
        self.areaRectitud = Rect(x, y, anch, alt) 
        
        x = 558 + sumarAX
        y = 430 + 30 + sumarAY
        anch = 141
        alt = 141
        self.areaAmor = Rect(x, y, anch, alt) 
        
        x = 297 + sumarAX
        y = 430 + 30 + sumarAY
        anch = 141
        alt = 141
        self.areaNoViolencia = Rect(x, y, anch, alt) 
        
        x = 216 + sumarAX
        y = 197 + 15 + sumarAY
        anch = 141
        alt = 141
        self.areaVerdad = Rect(x, y, anch, alt)    
        
        # imgBtnRegresar = Servicios.cargarImagen("boton_regresar.png", "imagenes")
        # imgBtnRegresarSelec = Servicios.cargarImagen("boton_regresar_selec.png", "imagenes")
        
        resource.set_images_path(os.path.join("imagenes"))
        imgBtnRegresar = resource.get_image("boton_regresar.png")
        imgBtnRegresarSelec = resource.get_image("boton_regresar_selec.png")
        
        self.btnRegresar = Boton.Boton(imgBtnRegresar, imgBtnRegresarSelec, (self.ancho - 214 - 10), 10)
        
        self.initFont()
        
        self.intro = True
        self.msjInicio = MensajeEmergente.MensajeInicial(40, "Tablero")
Пример #7
0
    def __init__(self, screen, clock, cursor, tipo, padre):

        # nuevo
        resource.set_images_path(os.path.join("imagenes"))
        self.transparente = resource.get_image("transparente.png")
        resource.set_images_path(os.path.join("imagenes", "citas"))
        self.inicio2 = resource.get_image("Bot_inicio_selec.png")
        self.fin2 = resource.get_image("Bot_fin_selec.png")
        self.background = resource.get_image("Fondo_lago.jpg", False)

        self.screen = screen
        self.clock = clock
        self.cursor = cursor
        self.mouse = Cursor.Mouse()
        self.tipo = tipo
        self.tablero = padre

        #Botones
        imgBtnLimpiar = resource.get_image("Bot_limpiar.png")
        imgBtnLimpiarSelect = resource.get_image("Bot_limpiar_selec.png")
        self.botonLimpiar = Boton.Boton(imgBtnLimpiar, imgBtnLimpiarSelect,
                                        1200 - 530, 10)

        imgBtnRegresar = resource.get_image("boton_regresar.png")
        imgBtnRegresarSelec = resource.get_image("boton_regresar_selec.png")
        self.btnRegresar = Boton.Boton(imgBtnRegresar, imgBtnRegresarSelec,
                                       (1200 - 214 - 10), 10)

        imgBtnAyuda = resource.get_image("BotonesAyuda.png")
        imgBtnAyudaSelec = resource.get_image("BotonesAyuda_selec.png")
        self.btnAyuda = Boton.Boton(imgBtnAyuda, imgBtnAyudaSelec,
                                    (1200 - 600), 10)

        self.inicio = True
        self.juego = False
        self.terminar = False
        self.gano = False

        self.msjInicio = MensajeEmergente.MensajeInicial(40, "Cita")

        self.piedraFactory = piedraFactory.PiedraFactory()

        #self.instrucciones = pygame.image.load(os.path.join("imagenes", "citas", "inicioFrases.png")).convert_alpha()

        # copiar y pegar de aqui pa abajo y despues agregar lo del tablero.run

        self.level = nivel.Nivel()
        # amor
        if self.tipo == 1:

            self.msjGanaste = MensajeEmergente.MensajeGanaste(40, "CitaAmor")
            #self.letrero = pygame.image.load(os.path.join("imagenes", "citas", "letreroAmor.png")).convert_alpha()

            self.correcto = [
                91, 76, 61, 46, 31, 32, 33, 34, 35, 36, 37, 52, 67, 82, 81, 80,
                79, 94, 109, 124, 139, 140, 141, 142, 143, 144, 129, 114, 99,
                84, 69, 54, 39, 40, 41, 56, 71, 86, 101, 116, 131, 146, 147,
                148, 133, 118, 103, 88, 73, 58, 59, 60, 75, 90, 105, 120, 135
            ]
            self.correcto2 = [
                91, 76, 61, 46, 31, 32, 33, 34, 35, 36, 37, 52, 67, 82, 81, 80,
                79, 94, 109, 124, 139, 140, 141, 142, 143, 144, 129, 114, 99,
                84, 69, 54, 39, 40, 41, 56, 71, 86, 101, 116, 131, 146, 147,
                148, 133, 118, 103, 88, 73, 58, 59, 60, 75, 90, 105, 120, 135
            ]

        # rectitud
        if self.tipo == 2:
            self.msjGanaste = MensajeEmergente.MensajeGanaste(
                40, "CitaRectitud")
            #self.letrero = pygame.image.load(os.path.join("imagenes", "citas", "letreroRectitud.png")).convert_alpha()

            self.correcto = [
                31, 46, 61, 76, 91, 106, 121, 136, 137, 138, 139, 124, 109, 94,
                95, 96, 97, 98, 83, 68, 53, 38, 39, 40, 55, 70, 85, 100, 115,
                130, 131, 132, 117, 102, 87, 72, 57, 42, 27, 28, 29, 30, 45,
                60, 75, 90, 105, 120
            ]
            self.correcto2 = [
                31, 46, 61, 76, 91, 106, 121, 136, 137, 138, 139, 124, 109, 94,
                95, 96, 97, 98, 83, 68, 53, 38, 39, 40, 55, 70, 85, 100, 115,
                130, 131, 132, 117, 102, 87, 72, 57, 42, 27, 28, 29, 30, 45,
                60, 75, 90, 105, 120
            ]

        # paz
        if self.tipo == 3:
            self.msjGanaste = MensajeEmergente.MensajeGanaste(40, "CitaPaz")
            #self.letrero = pygame.image.load(os.path.join("imagenes", "citas", "letreroPaz.png")).convert_alpha()

            self.correcto = [
                121, 106, 91, 92, 93, 78, 63, 48, 33, 34, 35, 50, 65, 80, 95,
                96, 97, 98, 113, 128, 143, 144, 145, 130, 115, 116, 117, 132,
                147, 148, 149, 150, 135, 120, 105
            ]
            self.correcto2 = [
                121, 106, 91, 92, 93, 78, 63, 48, 33, 34, 35, 50, 65, 80, 95,
                96, 97, 98, 113, 128, 143, 144, 145, 130, 115, 116, 117, 132,
                147, 148, 149, 150, 135, 120, 105
            ]

        # verdad
        if self.tipo == 4:
            self.msjGanaste = MensajeEmergente.MensajeGanaste(40, "CitaVerdad")
            #self.letrero = pygame.image.load(os.path.join("imagenes", "citas", "letreroVerdad.png")).convert_alpha()

            self.correcto = [
                17, 18, 33, 48, 63, 78, 93, 94, 95, 96, 97, 98, 113, 128, 143,
                144, 145, 146, 131, 116, 101, 86, 71, 56, 41, 26, 27, 28, 43,
                58, 73, 88, 103, 118, 119, 120, 105, 90, 75
            ]
            self.correcto2 = [
                17, 18, 33, 48, 63, 78, 93, 94, 95, 96, 97, 98, 113, 128, 143,
                144, 145, 146, 131, 116, 101, 86, 71, 56, 41, 26, 27, 28, 43,
                58, 73, 88, 103, 118, 119, 120, 105, 90, 75
            ]

        # no violencia
        if self.tipo == 5:
            self.msjGanaste = MensajeEmergente.MensajeGanaste(
                40, "CitaNoViolencia")
            #self.letrero = pygame.image.load(os.path.join("imagenes", "citas", "letreroNoViolencia.png")).convert_alpha()

            self.correcto = [
                31, 46, 61, 76, 91, 106, 121, 122, 123, 108, 93, 78, 63, 48,
                49, 50, 51, 66, 81, 96, 111, 126, 141, 142, 143, 128, 113, 98,
                83, 84, 85, 86, 101, 116, 131, 146, 147, 148, 133, 118, 103,
                88, 73, 58, 43, 28, 29, 30, 45, 60, 75, 90, 105
            ]
            self.correcto2 = [
                31, 46, 61, 76, 91, 106, 121, 122, 123, 108, 93, 78, 63, 48,
                49, 50, 51, 66, 81, 96, 111, 126, 141, 142, 143, 128, 113, 98,
                83, 84, 85, 86, 101, 116, 131, 146, 147, 148, 133, 118, 103,
                88, 73, 58, 43, 28, 29, 30, 45, 60, 75, 90, 105
            ]

        self.correcto.sort(reverse=False)
        self.hundidas = []

        self.alfabeto = [
            "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
            "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y",
            "Z"
        ]

        self.rutaFuente = os.path.join("fuentes", "PatrickHand-Regular.ttf")

        self.fuente = pygame.font.Font(self.rutaFuente, 40)

        self.piedras = pygame.sprite.Group()
        self.bloques = pygame.sprite.Group()

        self.cargarPiedras()

        # tiempo
        self.starttime = datetime.datetime.now()
Пример #8
0
    def run(self):

        resource.set_images_path(os.path.join("imagenes"))

        if self.mostrarCreditos:
            creditos = resource.get_image("Creditos.jpg", False)
            self.mostrarCreditos = False
            self.screen.blit(creditos, (0, 0))
            pygame.display.update()

        fondo = resource.get_image("Fondo.jpg", False)
        logo = Servicios.cargarImagen("logo.png", self.dirImagenes)

        if self.personaje is None:
            imagenPersonaje = Servicios.cargarImagen(
                "Frente1.png", os.path.join("imagenes", "verdad"))
            self.personaje = Personaje.Personaje(5, 40, 175, "M",
                                                 imagenPersonaje)
            print "entro personaje"

        if self.tablero is None:
            self.tablero = tableroCentral.tableroCentral(
                self, self.cursor, self.screen, self.clock, self.ancho,
                self.alto)
            print "entro tablero"

        if self.tutorial is None:
            self.tutorial = VentanaTutorial.VentanaTutorial(
                self, self.cursor, self.screen, self.clock, self.ancho,
                self.alto)
            print "entro tutorial"

        if self.ventPersonaje is None:
            self.ventPersonaje = VentanaPersonaje.VentanaPersonaje(
                self, self.cursor, self.screen, self.clock, self.ancho,
                self.alto)
            print "entro ventPersonaje"
            self.musicaMenu.play(
                -1)  #reproducir la musica solo la primera vez que se corre

        #=======================================================================
        # resource.set_images_path(os.path.join("imagenes"))
        # fondo = resource.get_image("Fondo.jpg", False)
        # #fondo = Servicios.cargarImagen("Fondo.jpg", os.path.join("imagenes"), False)
        # logo = Servicios.cargarImagen("logo.png", self.dirImagenes)
        #=======================================================================

        salir = False

        while salir == False:
            for event in pygame.event.get():
                if event.type == QUIT:
                    pygame.quit()
                    sys.exit()

                if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:
                    if self.cursor.colliderect(self.btnJugar.rect):
                        salir = True
                        self.ventPersonaje.run()

                    #if self.cursor.colliderect(self.btnAprender.rect):
                    #salir = True
                    #self.tutorial.run()

                    if self.cursor.colliderect(self.btnSalir.rect):
                        salir = True
                        pygame.quit()
                        sys.exit()

            self.clock.tick(60)

            self.cursor.update()

            self.screen.blit(fondo, (0, 0))
            self.screen.blit(logo, (0, 0))

            self.btnJugar.update(self.screen, self.cursor)
            #self.btnAprender.update(self.screen, self.cursor)
            self.btnSalir.update(self.screen, self.cursor)

            pygame.display.update()
Пример #9
0
    def __init__(self, x_inicial, y_inicial, anch, sex, imagen):
        self.x = x_inicial
        self.y = y_inicial
        self.ancho = anch
        self.sexo = sex
        self.nombre = ""
        self.colegio = ""
        self.edad = ""
        
        self.imagenOriginal = imagen
        
        self.imagen = self.imagenOriginal
        self.alto = self.ancho * self.imagen.get_height() / self.imagen.get_width()
        self.imagen = pygame.transform.smoothscale(self.imagen, (self.ancho, self.alto))
        
        self.rect = pygame.Rect(self.x, self.y, self.ancho, self.alto)
        
        self.rect.left, self.rect.top = (self.x, self.y)
        
        resource.set_images_path(os.path.join("imagenes", "verdad"))
        
        self.imgDer1MOriginal = resource.get_image("Der1.png")
        self.imgDer2MOriginal = resource.get_image("Der2.png")
        self.imgDer3MOriginal = resource.get_image("Der4.png")
            
        self.imgIzq1MOriginal = resource.get_image("Izq1.png")
        self.imgIzq2MOriginal = resource.get_image("Izq2.png")
        self.imgIzq3MOriginal = resource.get_image("Izq4.png")
         
        self.imgArr1MOriginal = resource.get_image("Espalda1.png")
        self.imgArr2MOriginal = resource.get_image("Espalda2.png")
        self.imgArr3MOriginal = resource.get_image("Espalda4.png")
            
        self.imgAbj1MOriginal = resource.get_image("Frente1.png")
        self.imgAbj2MOriginal = resource.get_image("Frente2.png")
        self.imgAbj3MOriginal = resource.get_image("Frente4.png")
        
        self.imgDer1M = pygame.transform.smoothscale(self.imgDer1MOriginal, (self.ancho, self.alto))
        self.imgDer2M = pygame.transform.smoothscale(self.imgDer2MOriginal, (self.ancho, self.alto))
        self.imgDer3M = pygame.transform.smoothscale(self.imgDer3MOriginal, (self.ancho, self.alto))
        self.imgIzq1M = pygame.transform.smoothscale(self.imgIzq1MOriginal, (self.ancho, self.alto))
        self.imgIzq2M = pygame.transform.smoothscale(self.imgIzq2MOriginal, (self.ancho, self.alto))
        self.imgIzq3M = pygame.transform.smoothscale(self.imgIzq3MOriginal, (self.ancho, self.alto))
        self.imgArr1M = pygame.transform.smoothscale(self.imgArr1MOriginal, (self.ancho, self.alto))
        self.imgArr2M = pygame.transform.smoothscale(self.imgArr2MOriginal, (self.ancho, self.alto))
        self.imgArr3M = pygame.transform.smoothscale(self.imgArr3MOriginal, (self.ancho, self.alto))
        self.imgAbj1M = pygame.transform.smoothscale(self.imgAbj1MOriginal, (self.ancho, self.alto))
        self.imgAbj2M = pygame.transform.smoothscale(self.imgAbj2MOriginal, (self.ancho, self.alto))
        self.imgAbj3M = pygame.transform.smoothscale(self.imgAbj3MOriginal, (self.ancho, self.alto))
        
        self.imgDer1FOriginal = resource.get_image("Nina_Camina-09.png")
        self.imgDer2FOriginal = resource.get_image("Nina_Camina-10.png")
        self.imgDer3FOriginal = resource.get_image("Nina_Camina-12.png")
         
        self.imgIzq1FOriginal = resource.get_image("Nina_Camina-05.png")
        self.imgIzq2FOriginal = resource.get_image("Nina_Camina-06.png")
        self.imgIzq3FOriginal = resource.get_image("Nina_Camina-08.png")
           
        self.imgArr1FOriginal = resource.get_image("Nina_Camina-13.png")
        self.imgArr2FOriginal = resource.get_image("Nina_Camina-14.png")
        self.imgArr3FOriginal = resource.get_image("Nina_Camina-16.png")
             
        self.imgAbj1FOriginal = resource.get_image("Nina_Camina-01.png")
        self.imgAbj2FOriginal = resource.get_image("Nina_Camina-02.png")
        self.imgAbj3FOriginal = resource.get_image("Nina_Camina-04.png")
        
        self.imgDer1F = pygame.transform.smoothscale(self.imgDer1FOriginal, (self.ancho, self.alto))
        self.imgDer2F = pygame.transform.smoothscale(self.imgDer2FOriginal, (self.ancho, self.alto))
        self.imgDer3F = pygame.transform.smoothscale(self.imgDer3FOriginal, (self.ancho, self.alto))
        self.imgIzq1F = pygame.transform.smoothscale(self.imgIzq1FOriginal, (self.ancho, self.alto))
        self.imgIzq2F = pygame.transform.smoothscale(self.imgIzq2FOriginal, (self.ancho, self.alto))
        self.imgIzq3F = pygame.transform.smoothscale(self.imgIzq3FOriginal, (self.ancho, self.alto))
        self.imgArr1F = pygame.transform.smoothscale(self.imgArr1FOriginal, (self.ancho, self.alto))
        self.imgArr2F = pygame.transform.smoothscale(self.imgArr2FOriginal, (self.ancho, self.alto))
        self.imgArr3F = pygame.transform.smoothscale(self.imgArr3FOriginal, (self.ancho, self.alto))
        self.imgAbj1F = pygame.transform.smoothscale(self.imgAbj1FOriginal, (self.ancho, self.alto))
        self.imgAbj2F = pygame.transform.smoothscale(self.imgAbj2FOriginal, (self.ancho, self.alto))
        self.imgAbj3F = pygame.transform.smoothscale(self.imgAbj3FOriginal, (self.ancho, self.alto))
        
        if self.sexo == "M":
            self.imgDer1 = self.imgDer1M
            self.imgDer2 = self.imgDer2M
            self.imgDer3 = self.imgDer3M

            self.imgIzq1 = self.imgIzq1M
            self.imgIzq2 = self.imgIzq2M
            self.imgIzq3 = self.imgIzq3M

            self.imgArr1 = self.imgArr1M
            self.imgArr2 = self.imgArr2M
            self.imgArr3 = self.imgArr3M

            self.imgAbj1 = self.imgAbj1M
            self.imgAbj2 = self.imgAbj2M
            self.imgAbj3 = self.imgAbj3M 
        else:
            self.imgDer1 = self.imgDer1F
            self.imgDer2 = self.imgDer2F
            self.imgDer3 = self.imgDer3F

            self.imgIzq1 = self.imgIzq1F
            self.imgIzq2 = self.imgIzq2F
            self.imgIzq3 = self.imgIzq3F

            self.imgArr1 = self.imgArr1F
            self.imgArr2 = self.imgArr2F
            self.imgArr3 = self.imgArr3F

            self.imgAbj1 = self.imgAbj1F
            self.imgAbj2 = self.imgAbj2F
            self.imgAbj3 = self.imgAbj3F
Пример #10
0
 def __init__(self, centro, sex):
     pygame.sprite.Sprite.__init__(self) 
     
     self.poderoso = False
     
     """Cuanto me voy a mover"""
     self.x_dist = 1
     self.y_dist = 1
     """que tanto me estoy moviendo"""
     self.xMove = 0
     self.yMove = 0
     
     if sex == "M":
     
         resource.set_images_path(os.path.join("imagenes", "verdad"))
         imgDer1 = resource.get_image("Der1.png")
         imgDer2 = resource.get_image("Der2.png")
         imgDer3 = resource.get_image("Der4.png")
         imgDer1 = pygame.transform.smoothscale(imgDer1, (25, 40))
         imgDer2 = pygame.transform.smoothscale(imgDer2, (25, 40))
         imgDer3 = pygame.transform.smoothscale(imgDer3, (25, 40))
         
         
         
         self.imgDers = [imgDer1, imgDer2, imgDer1, imgDer3]
         
         imgIzq1 = resource.get_image("Izq1.png")
         imgIzq2 = resource.get_image("Izq2.png")
         imgIzq3 = resource.get_image("Izq4.png")
         imgIzq1 = pygame.transform.smoothscale(imgIzq1, (25, 40))
         imgIzq2 = pygame.transform.smoothscale(imgIzq2, (25, 40))
         imgIzq3 = pygame.transform.smoothscale(imgIzq3, (25, 40))
         self.imgIzqs = [imgIzq1, imgIzq2, imgIzq1, imgIzq3]
         
         imgArr1 = resource.get_image("Espalda1.png")
         imgArr2 = resource.get_image("Espalda2.png")
         imgArr3 = resource.get_image("Espalda4.png")
         imgArr1 = pygame.transform.smoothscale(imgArr1, (25, 40))
         imgArr2 = pygame.transform.smoothscale(imgArr2, (25, 40))
         imgArr3 = pygame.transform.smoothscale(imgArr3, (25, 40))
         self.imgArrs = [imgArr1, imgArr2, imgArr1, imgArr3]
         
         imgAbj1 = resource.get_image("Frente1.png")
         imgAbj2 = resource.get_image("Frente2.png")
         imgAbj3 = resource.get_image("Frente4.png")
         imgAbj1 = pygame.transform.smoothscale(imgAbj1, (25, 40))
         imgAbj2 = pygame.transform.smoothscale(imgAbj2, (25, 40))
         imgAbj3 = pygame.transform.smoothscale(imgAbj3, (25, 40))
         self.imgAbjs = [imgAbj1, imgAbj2, imgAbj1, imgAbj3]
         
     else:
         resource.set_images_path(os.path.join("imagenes", "verdad"))
         imgDer1 = resource.get_image("Nina_Camina-09.png")
         imgDer2 = resource.get_image("Nina_Camina-10.png")
         imgDer3 = resource.get_image("Nina_Camina-12.png")
         imgDer1 = pygame.transform.smoothscale(imgDer1, (25, 40))
         imgDer2 = pygame.transform.smoothscale(imgDer2, (25, 40))
         imgDer3 = pygame.transform.smoothscale(imgDer3, (25, 40))
         
         
         
         self.imgDers = [imgDer1, imgDer2, imgDer1, imgDer3]
         
         imgIzq1 = resource.get_image("Nina_Camina-05.png")
         imgIzq2 = resource.get_image("Nina_Camina-06.png")
         imgIzq3 = resource.get_image("Nina_Camina-08.png")
         imgIzq1 = pygame.transform.smoothscale(imgIzq1, (25, 40))
         imgIzq2 = pygame.transform.smoothscale(imgIzq2, (25, 40))
         imgIzq3 = pygame.transform.smoothscale(imgIzq3, (25, 40))
         self.imgIzqs = [imgIzq1, imgIzq2, imgIzq1, imgIzq3]
         
         imgArr1 = resource.get_image("Nina_Camina-13.png")
         imgArr2 = resource.get_image("Nina_Camina-14.png")
         imgArr3 = resource.get_image("Nina_Camina-16.png")
         imgArr1 = pygame.transform.smoothscale(imgArr1, (25, 40))
         imgArr2 = pygame.transform.smoothscale(imgArr2, (25, 40))
         imgArr3 = pygame.transform.smoothscale(imgArr3, (25, 40))
         self.imgArrs = [imgArr1, imgArr2, imgArr1, imgArr3]
         
         imgAbj1 = resource.get_image("Nina_Camina-01.png")
         imgAbj2 = resource.get_image("Nina_Camina-02.png")
         imgAbj3 = resource.get_image("Nina_Camina-04.png")
         imgAbj1 = pygame.transform.smoothscale(imgAbj1, (25, 40))
         imgAbj2 = pygame.transform.smoothscale(imgAbj2, (25, 40))
         imgAbj3 = pygame.transform.smoothscale(imgAbj3, (25, 40))
         self.imgAbjs = [imgAbj1, imgAbj2, imgAbj1, imgAbj3]
     
     self.image = imgAbj1
     self.rect = self.image.get_rect()
     self.rect.center = centro
     
     self.anim_pacmanCurrent = self.imgAbjs
     self.animFrame = 0;
     
     self.starttime = datetime.datetime.now()