ya2 · news · projects · code · about

configuration
[pmachines.git] / pmachines / music.py
index 71d2cf15a6ad5296875a3600578afde38bf87685..16e13dc9827052f777bcfd2d759111a6ec31aac7 100644 (file)
@@ -6,10 +6,10 @@ from panda3d.core import AudioSound
 
 class MusicMgr:
 
-    def __init__(self):
+    def __init__(self, volume):
         self._start_music(glob('assets/audio/music/*.ogg'))
-        base.musicManager.setVolume(.8)
-        base.sfxManagerList[0].setVolume(1)
+        base.musicManager.setVolume(.8 * volume)
+        base.sfxManagerList[0].setVolume(volume)
         taskMgr.add(self._on_frame, 'on frame music')
 
     def _start_music(self, files):