def die(self, camera): if self.is_dead(): self.kill() v = calculate_volume(self.rect, camera) if v > 0: self.die_fx.set_volume(v) self.die_fx.play()
def play_sounds(self, camera): if self is self.mgr.active: for s in self.active_sounds: s.play() v = calculate_volume(self.rect, camera) if v > 0: for s in self.camera_sounds: s.set_volume(v) s.play() self.active_sounds = [] self.camera_sounds = []