Ignore:
Timestamp:
06/14/09 14:08:23 (11 years ago)
Author:
maximinus_parpg
Message:

Added 'm' button to toggle music on/off.
Updated README file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/sounds.py

    r134 r135  
    2525        # set up the sound 
    2626        self.music = self.sound_engine.createEmitter() 
     27        self.music_on = False 
    2728     
    2829    def playMusic(self, sfile = None): 
     
    3334            self.music.setLooping(True) 
    3435        self.music.play() 
     36        self.music_on = True 
    3537     
    3638    def pauseMusic(self): 
    3739        """Stop current playback""" 
    38         self.music.stop() 
     40        self.music.pause() 
     41        self.music_on = False 
     42 
     43    def toggleMusic(self): 
     44        if(self.music_on == False): 
     45            self.playMusic() 
     46        else: 
     47            self.pauseMusic() 
    3948 
    4049    def setVolume(self, volume): 
Note: See TracChangeset for help on using the changeset viewer.