diff options
Diffstat (limited to 'brutalmaze/misc.py')
-rw-r--r-- | brutalmaze/misc.py | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/brutalmaze/misc.py b/brutalmaze/misc.py index e5d1016..60d89c9 100644 --- a/brutalmaze/misc.py +++ b/brutalmaze/misc.py @@ -91,27 +91,10 @@ def json_rec(directory): def play(sound: str, x: float = MIDDLE, y: float = MIDDLE, - gain: float = 1.0) -> None: + gain: float = 1.0) -> Source: """Play a sound at the given position.""" source = Buffer(sound).play() source.spatialize = True source.position = x, -y, 0 source.gain = gain - sources.append(source) - - -def clean_sources(stopped=True) -> None: - """Destroyed stopped sources. - - If stopped is set to False, clean all sources. - """ - global sources - sources, tmp = [], sources - for source in tmp: - if stopped and source.playing: - sources.append(source) - else: - source.destroy() - - -sources = [] + return source |