def update(self, delta): if self.pause: AudioManager.set_music_volume(0.1) return if self.shooting: self.world.playership.shoot() if not(self.pause): AudioManager.set_music_volume(1) self.world.update(delta) self.running = self.running and not self.world.gameover self.debug_fps = 1 / delta if self.world.standby_ennemies == [] and self.world.active_ennemies == [] and self.world.bullets == []: self.timerEnd += delta if self.timerEnd >= 3: self.score.add_score(self.world.score) self.score.save() self.running = False
def update(self, delta): if self.pause: AudioManager.set_music_volume(0.1) return if self.shooting: self.world.playership.shoot() if not(self.pause): AudioManager.set_music_volume(1) self.world.update(delta) self.running = self.running and not self.world.gameover self.debug_fps = 1 / delta # new ennemies if self.world.active_ennemies == [] and self.world.standby_ennemies == [] and self.currentlevel < 4: self.currentlevel += 1 level = Level(self.currentlevel, self.world, self.world.camera.y, 20) self.world.standby_ennemies = level.level elif self.world.active_ennemies == [] and self.world.standby_ennemies == [] and self.currentlevel == 4: level = Level(self.currentlevel, self.world, self.world.camera.y, 20) self.world.standby_ennemies = level.level