def postConstructor(self): #crear aray de disparos self.disparos = pygame.sprite.Group() self.sonido_lasser = SoundUtil.loadSound(self, 'lasser_short.ogg') self.sonido_lasser.set_volume(0.5) self.vida = 6 self.score = 0 self.incremento_score = 125
def gameOver(self): #game over self.inExecute = False #texto game over gameOverRender = self.font.render("GAME OVER", 1, (255,0,0)) self.screen.blit(gameOverRender, ((self.screenWidth/2) - 20, (self.screenHeight/ 2)- 10)) if self.playGameOverSound: self.level.sound_level.stop() gameOverSound = SoundUtil.loadSound(self, 'game_over_robot.wav') gameOverSound.set_volume(self.level.volumen_musica) gameOverSound.play() self.playGameOverSound = False #resetear el juego al pulsar enter, mientras se queda esperando keys=pygame.key.get_pressed() if (keys[pygame.K_ESCAPE]): self.initialScreen = True self.level.vidas = 0
def resetLevelAtributes(self): #sonidos del juego self.sound_level = SoundUtil.loadSound(self, 'cosmic-air-way-arrange.ogg') self.sound_level.set_volume(self.volumen_musica) self.sound_level.play()