Esempio n. 1
0
def main():
    pygame.init()
    screen = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
    pygame.display.set_caption("informacion")
    fuente = pygame.font.Font(None, 25)
    imagen=pygame.image.load("botones/InstruccionI.png")
    screen.blit(imagen,(0,0))
    
    pygame.display.flip()
    
    while True:
        
        for event in pygame.event.get():
            keys=pygame.key.get_pressed()
            if event.type == pygame.QUIT:
                sys.exit()
            if keys[K_ESCAPE]:
                ext=ventanaInicial.ventanaIni()
                ext.main()
                pygame.display.quit()
    def update(self):
        keys = pygame.key.get_pressed()
        if keys[K_LEFT]:
            self.sprite1.rect.left = self.sprite1.rect.left - 1
            self.tux = pygame.image.load(self.arreglo_izqui[self.j])
            if (self.sprite1.rect.left >= 70 and self.sprite1.rect.left <= 110) and (
                self.sprite1.rect.top >= 80 and self.sprite1.rect.top <= 130
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 10 and self.sprite1.rect.left <= 70) and (
                self.sprite1.rect.top >= 80 and self.sprite1.rect.top <= 130
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 320 and self.sprite1.rect.left <= 380) and (
                self.sprite1.rect.top >= 150 and self.sprite1.rect.top <= 200
            ):
                self.sonidoArriba.play()

            if (self.sprite1.rect.left >= 475 and self.sprite1.rect.left <= 500) and (
                self.sprite1.rect.top >= 140 and self.sprite1.rect.top <= 200
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 440 and self.sprite1.rect.left <= 475) and (
                self.sprite1.rect.top >= 140 and self.sprite1.rect.top <= 200
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 60 and self.sprite1.rect.left <= 230) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 5 and self.sprite1.rect.left <= 60) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 440) and (
                self.sprite1.rect.top >= 250 and self.sprite1.rect.top <= 300
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 300) and (
                self.sprite1.rect.top >= 250 and self.sprite1.rect.top <= 300
            ):
                self.sonidoAbajo.play()

            if self.j == 7:
                self.j = 0
            self.sprite1.imagen = self.tux
            self.j = self.j + 1

        elif keys[K_RIGHT]:
            self.sprite1.rect.left = self.sprite1.rect.left + 1
            self.tux = pygame.image.load(self.arreglo_derecho[self.i])

            if (self.sprite1.rect.left >= 20 and self.sprite1.rect.left <= 110) and (
                self.sprite1.rect.top >= 35 and self.sprite1.rect.top <= 80
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 110 and self.sprite1.rect.left <= 140) and (
                self.sprite1.rect.top >= 35 and self.sprite1.rect.top <= 80
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 50 and self.sprite1.rect.left <= 160) and (
                self.sprite1.rect.top >= 120 and self.sprite1.rect.top <= 180
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 160 and self.sprite1.rect.left <= 210) and (
                self.sprite1.rect.top >= 120 and self.sprite1.rect.top <= 180
            ):
                self.sonidoArriba.play()

            if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 290) and (
                self.sprite1.rect.top >= 35 and self.sprite1.rect.top <= 80
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 290 and self.sprite1.rect.left <= 340) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 340 and self.sprite1.rect.left <= 420) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoArriba.play()

            if (self.sprite1.rect.left >= 430 and self.sprite1.rect.left <= 500) and (
                self.sprite1.rect.top >= 100 and self.sprite1.rect.top <= 160
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 320 and self.sprite1.rect.left <= 380) and (
                self.sprite1.rect.top >= 40 and self.sprite1.rect.top <= 100
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 500 and self.sprite1.rect.left <= 550) and (
                self.sprite1.rect.top >= 100 and self.sprite1.rect.top <= 160
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 475 and self.sprite1.rect.left <= 560) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 560 and self.sprite1.rect.left <= 610) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 600 and self.sprite1.rect.left <= 660) and (
                self.sprite1.rect.top >= 390 and self.sprite1.rect.top <= 430
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 60 and self.sprite1.rect.left <= 80) and (
                self.sprite1.rect.top >= 460 and self.sprite1.rect.top <= 515
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 360) and (
                self.sprite1.rect.top >= 430 and self.sprite1.rect.top <= 500
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 730 and self.sprite1.rect.left <= 750) and (
                self.sprite1.rect.top >= 460 and self.sprite1.rect.top <= 500
            ):
                pygame.display.quit()
                game = nivelDificil.Game()
                game.mainLoop()

            if (self.sprite1.rect.left >= 130 and self.sprite1.rect.left <= 150) and (
                self.sprite1.rect.top >= 470 and self.sprite1.rect.top <= 510
            ):
                pygame.mixer.music.stop()
                ext = ventanaInicial.ventanaIni()
                ext.main()
                pygame.display.quit()

            if (self.sprite1.rect.left >= 360 and self.sprite1.rect.left <= 390) and (
                self.sprite1.rect.top >= 470 and self.sprite1.rect.top <= 510
            ):
                self.x = 30
                self.y = 35
                self.sprite1.rect.top = self.y
                self.sprite1.rect.left = self.x
                self.screen.blit(self.sprite1.imagen, self.sprite1.rect)

            if self.i == 7:
                self.i = 0
            self.sprite1.imagen = self.tux
            self.i = self.i + 1

        elif keys[K_UP]:
            self.sprite1.rect.top = self.sprite1.rect.top - 1
            self.tux = pygame.image.load(self.arreglo_arriba[self.k])
            if (self.sprite1.rect.left >= 160 and self.sprite1.rect.left <= 240) and (
                self.sprite1.rect.top >= 80 and self.sprite1.rect.top <= 140
            ):
                self.sonidoArriba.play()

            if (self.sprite1.rect.left >= 160 and self.sprite1.rect.left <= 240) and (
                self.sprite1.rect.top >= 35 and self.sprite1.rect.top <= 80
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 320 and self.sprite1.rect.left <= 480) and (
                self.sprite1.rect.top >= 150 and self.sprite1.rect.top <= 200
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 320 and self.sprite1.rect.left <= 380) and (
                self.sprite1.rect.top >= 100 and self.sprite1.rect.top <= 150
            ):
                self.sonidoArriba.play()

            if (self.sprite1.rect.left >= 240 and self.sprite1.rect.left <= 290) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 320 and self.sprite1.rect.left <= 380) and (
                self.sprite1.rect.top >= 40 and self.sprite1.rect.top <= 100
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 130 and self.sprite1.rect.left <= 170) and (
                self.sprite1.rect.top >= 470 and self.sprite1.rect.top <= 500
            ):
                self.sonidoArriba.play()

            if self.k == 7:
                self.k = 0
            self.sprite1.imagen = self.tux
            self.k = self.k + 1

        elif keys[K_DOWN]:
            self.sprite1.rect.top = self.sprite1.rect.top + 1
            self.tux = pygame.image.load(self.arreglo_abajo[self.l])

            if (self.sprite1.rect.left >= 110 and self.sprite1.rect.left <= 160) and (
                self.sprite1.rect.top >= 80 and self.sprite1.rect.top <= 110
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 10 and self.sprite1.rect.left <= 70) and (
                self.sprite1.rect.top >= 150 and self.sprite1.rect.top <= 200
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 240 and self.sprite1.rect.left <= 290) and (
                self.sprite1.rect.top >= 80 and self.sprite1.rect.top <= 200
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 240 and self.sprite1.rect.left <= 290) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 320 and self.sprite1.rect.left <= 380) and (
                self.sprite1.rect.top >= 40 and self.sprite1.rect.top <= 100
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 380 and self.sprite1.rect.left <= 430) and (
                self.sprite1.rect.top >= 110 and self.sprite1.rect.top <= 170
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 500 and self.sprite1.rect.left <= 550) and (
                self.sprite1.rect.top >= 140 and self.sprite1.rect.top <= 200
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 440 and self.sprite1.rect.left <= 475) and (
                self.sprite1.rect.top >= 200 and self.sprite1.rect.top <= 250
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 560 and self.sprite1.rect.left <= 610) and (
                self.sprite1.rect.top >= 250 and self.sprite1.rect.top <= 390
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 560 and self.sprite1.rect.left <= 610) and (
                self.sprite1.rect.top >= 390 and self.sprite1.rect.top <= 430
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 600 and self.sprite1.rect.left <= 660) and (
                self.sprite1.rect.top >= 430 and self.sprite1.rect.top <= 510
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 5 and self.sprite1.rect.left <= 60) and (
                self.sprite1.rect.top >= 250 and self.sprite1.rect.top <= 460
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 5 and self.sprite1.rect.left <= 60) and (
                self.sprite1.rect.top >= 460 and self.sprite1.rect.top <= 515
            ):
                self.sonidoDerecha.play()

            if (self.sprite1.rect.left >= 440 and self.sprite1.rect.left <= 475) and (
                self.sprite1.rect.top >= 250 and self.sprite1.rect.top <= 300
            ):
                self.sonidoIzquierda.play()

            if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 300) and (
                self.sprite1.rect.top >= 300 and self.sprite1.rect.top <= 440
            ):
                self.sonidoAbajo.play()

            if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 300) and (
                self.sprite1.rect.top >= 440 and self.sprite1.rect.top <= 510
            ):
                self.sonidoDerecha.play()

            if self.l == 7:
                self.l = 0

            self.sprite1.imagen = self.tux
            self.l = self.l + 1

        elif keys[K_ESCAPE]:
            self.exit()

        elif keys[K_SPACE]:
            pygame.mixer.music.load("musica\musi.mp3")
            pygame.mixer.music.play(1)

        elif keys[K_END]:
            pygame.mixer.music.stop()
        elif keys[K_PAGEUP]:
            pygame.mixer.music.pause()
        elif keys[K_PAGEDOWN]:
            pygame.mixer.music.unpause()

        return
Esempio n. 3
0
 def update(self):
     keys=pygame.key.get_pressed()
     if keys[K_LEFT]:
         self.sprite1.rect.left=self.sprite1.rect.left - 1
         if (self.sprite1.rect.left >= 10 and self.sprite1.rect.left <= 50) and (self.sprite1.rect.top >= 430 and self.sprite1.rect.top <= 480):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 50 and self.sprite1.rect.left <= 150) and (self.sprite1.rect.top >= 430 and self.sprite1.rect.top <= 480):
             self.sonidoError.play()
         
         if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 120 and self.sprite1.rect.top <=170):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 300) and (self.sprite1.rect.top >= 370 and self.sprite1.rect.top <= 420):
             self.sonidoIzquierda.play()
         
         if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 250) and (self.sprite1.rect.top >= 370 and self.sprite1.rect.top <= 420):
             self.sonidoAbajo.play()
         
         #if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 250) and (self.sprite1.rect.top >= 370 and self.sprite1.rect.top <= 420):
         
             
             
         self.tux = pygame.image.load(self.arreglo_izqui[self.j])
         if self.j==7:
             self.j=0
         self.sprite1.imagen = self.tux
         self.j=self.j+1
         
         
     elif keys[K_RIGHT]:
         if (self.sprite1.rect.left >= 10 and self.sprite1.rect.left <= 50) and (self.sprite1.rect.top >= 440 and self.sprite1.rect.top <= 480):
             self.sonidoArriba.play()
             
         if (self.sprite1.rect.left >= 50 and self.sprite1.rect.left <= 150) and (self.sprite1.rect.top >= 180 and self.sprite1.rect.top <= 260):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 150 and self.sprite1.rect.left <= 200) and (self.sprite1.rect.top >= 180 and self.sprite1.rect.top <= 260):
             self.sonidoAbajo.play()
             
         if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 300) and (self.sprite1.rect.top >= 320 and self.sprite1.rect.top <= 370):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 320 and self.sprite1.rect.top <= 370):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 350 and self.sprite1.rect.left <= 400) and (self.sprite1.rect.top >= 170 and self.sprite1.rect.top <= 270):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 350 and self.sprite1.rect.left <= 400) and (self.sprite1.rect.top >= 70 and self.sprite1.rect.top <=120):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 400 and self.sprite1.rect.left <= 450) and (self.sprite1.rect.top >= 70 and self.sprite1.rect.top <=120):
             self.sonidoAbajo.play()    
         
         if (self.sprite1.rect.left >= 450 and self.sprite1.rect.left <= 550) and (self.sprite1.rect.top >= 170 and self.sprite1.rect.top <=220):
             self.sonidoDerecha.play()
             
         if (self.sprite1.rect.left >= 550 and self.sprite1.rect.left <= 600) and (self.sprite1.rect.top >= 170 and self.sprite1.rect.top <=220):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 600 and self.sprite1.rect.left <= 750) and (self.sprite1.rect.top >= 20 and self.sprite1.rect.top <=70):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 420 and self.sprite1.rect.top <= 470):
             self.sonidoDerecha.play()    
         
         if (self.sprite1.rect.left >= 350 and self.sprite1.rect.left <= 400) and (self.sprite1.rect.top >= 420 and self.sprite1.rect.top <= 470):
             self.sonidoArriba.play()    
         
         if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 250) and (self.sprite1.rect.top >= 180 and self.sprite1.rect.top <= 260):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 720 and self.sprite1.rect.left <= 750) and (self.sprite1.rect.top >= 30 and self.sprite1.rect.top <= 80):
             
             widget = Button(None, text='G A N A S T E S')
             widget.pack()
             widget.bind('<Button-1>', hello)             
             widget.bind('<First-1>', quit)              
             widget.mainloop()
             
         if (self.sprite1.rect.left >= 400 and self.sprite1.rect.left <= 440) and (self.sprite1.rect.top >= 330 and self.sprite1.rect.top <= 370):
             pygame.mixer.music.stop()
             ext=ventanaInicial.ventanaIni()
             ext.main()
             pygame.display.quit()
         
         if (self.sprite1.rect.left >= 250 and self.sprite1.rect.left <= 290) and (self.sprite1.rect.top >= 40 and self.sprite1.rect.top <= 90):
             self.x = 30
             self.y = 440
             self.sprite1.rect.top = self.y
             self.sprite1.rect.left = self.x
             self.screen.blit(self.sprite1.imagen,self.sprite1.rect)
             
         if (self.sprite1.rect.left >= 500 and self.sprite1.rect.left <= 540) and (self.sprite1.rect.top >= 86 and self.sprite1.rect.top <= 120):
             pygame.mixer.music.stop()
             ext=ventanaInicial.ventanaIni()
             ext.main()
             pygame.display.quit()
             
         if (self.sprite1.rect.left >= 560 and self.sprite1.rect.left <= 600) and (self.sprite1.rect.top >= 280 and self.sprite1.rect.top <= 320):
             self.x = 30
             self.y = 440
             self.sprite1.rect.top = self.y
             self.sprite1.rect.left = self.x
             self.screen.blit(self.sprite1.imagen,self.sprite1.rect)
          
         
         self.sprite1.rect.left=self.sprite1.rect.left + 1
         self.tux = pygame.image.load(self.arreglo_derecho[self.i])
         if self.i==7:
             self.i=0
         self.sprite1.imagen = self.tux
         self.i=self.i+1
     
     elif keys[K_UP]:
         self.sprite1.rect.top=self.sprite1.rect.top - 1
         self.tux = pygame.image.load(self.arreglo_arriba[self.k])
         if (self.sprite1.rect.left >= 10 and self.sprite1.rect.left <= 50) and (self.sprite1.rect.top >= 260 and self.sprite1.rect.top <= 430):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 10 and self.sprite1.rect.left <= 50) and (self.sprite1.rect.top >= 180 and self.sprite1.rect.top <= 260):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 270 and self.sprite1.rect.top <= 320):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 170 and self.sprite1.rect.top <= 270):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 350 and self.sprite1.rect.left <= 400) and (self.sprite1.rect.top >= 120 and self.sprite1.rect.top <=170):
             self.sonidoIzquierda.play()
         
         if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 70 and self.sprite1.rect.top <=120):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 550 and self.sprite1.rect.left <= 600) and (self.sprite1.rect.top >= 70 and self.sprite1.rect.top <=170):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 550 and self.sprite1.rect.left <= 600) and (self.sprite1.rect.top >= 20 and self.sprite1.rect.top <=70):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 350 and self.sprite1.rect.left <= 400) and (self.sprite1.rect.top >= 370 and self.sprite1.rect.top <= 420):
             self.sonidoArriba.play()    
         
         if (self.sprite1.rect.left >= 350 and self.sprite1.rect.left <= 400) and (self.sprite1.rect.top >= 320 and self.sprite1.rect.top <= 370):
             self.sonidoDerecha.play()    
         
         if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 250) and (self.sprite1.rect.top >= 70 and self.sprite1.rect.top <= 180):
             self.sonidoArriba.play()
         
         if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 250) and (self.sprite1.rect.top >= 20 and self.sprite1.rect.top <= 70):
             self.sonidoDerecha.play()
             
             
         if self.k==7:
             self.k=0
         self.sprite1.imagen = self.tux
         self.k=self.k+1
         
     elif keys[K_DOWN]:
         self.sprite1.rect.top=self.sprite1.rect.top + 1
         self.tux = pygame.image.load(self.arreglo_abajo[self.l])
         
         if (self.sprite1.rect.left >= 150 and self.sprite1.rect.left <= 200) and (self.sprite1.rect.top >= 260 and self.sprite1.rect.top <= 320):
             self.sonidoAbajo.play()
         
         if (self.sprite1.rect.left >= 150 and self.sprite1.rect.left <= 200) and (self.sprite1.rect.top >= 320 and self.sprite1.rect.top <= 370):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 400 and self.sprite1.rect.left <= 450) and (self.sprite1.rect.top >= 120 and self.sprite1.rect.top <=170):
             self.sonidoAbajo.play() 
         
         if (self.sprite1.rect.left >= 400 and self.sprite1.rect.left <= 450) and (self.sprite1.rect.top >= 170 and self.sprite1.rect.top <=220):
             self.sonidoDerecha.play()
         
         if (self.sprite1.rect.left >= 300 and self.sprite1.rect.left <= 350) and (self.sprite1.rect.top >= 370 and self.sprite1.rect.top <= 420):
             self.sonidoIzquierda.play()
         
         if (self.sprite1.rect.left >= 200 and self.sprite1.rect.left <= 250) and (self.sprite1.rect.top >= 420 and self.sprite1.rect.top <= 470):
             self.sonidoDerecha.play()    
         
         
         if self.l==7:
             self.l=0
         self.sprite1.imagen = self.tux
         self.l=self.l+1
     
     elif keys[K_ESCAPE]:
         pygame.mixer.music.stop()
         ext=ventanaInicial.ventanaIni()
         ext.main()
         pygame.display.quit()
         
     # self.exit()
         
         
      
     elif keys[K_END]:
         pygame.mixer.music.stop()
     elif keys[K_PAGEUP]:
         pygame.mixer.music.pause()
     elif keys[K_PAGEDOWN]:
         pygame.mixer.music.unpause()
     
     return