Add Splash screen, begin music earlier, and control scroll speed with F1-F12
[base2-runner.git] / engine / Channel.py
index 71c6651..12f6215 100755 (executable)
@@ -18,8 +18,10 @@ class Channel:
  # use integers to control volume which avoids float rounding error issues
  MAX = 100
  MIN = 0
+ volume = 50
  volume_step = 5
- def __init__(self, volume=1.0, channel_id=0, debug=False):
+
+ def __init__(self, volume=50, channel_id=0, debug=False):
   """ Constructor.
    volume:     an SDL/PyGame floating-point with range 0.00 to 1.00. It is stored internally as an 
                integer with range 0 to 100 to avoid rounding errors when stepping the volume.
@@ -28,7 +30,6 @@ class Channel:
 
    self.channel == None indicates this is the Music channel.
   """
-  self.volume = int(volume*100)
   self.channel_id = 0
   self.debug = debug
   self.paused = False
@@ -39,6 +40,8 @@ class Channel:
    self.channel_id = channel_id
    self.channel = pygame.mixer.Channel(self.channel_id)
 
+  self.set_volume(int(volume))
+
  def set_volume(self, new_level):
   """ Ensure the new level is within legal range and alter the mixer level """
   if new_level >= Channel.MIN and new_level <= Channel.MAX: