Changeset 140


Ignore:
Timestamp:
06/15/09 09:16:27 (10 years ago)
Author:
maximinus_parpg
Message:

Fixed bug where music was unpaused between maps.
Added all internal walls to shanty building internals.

Location:
trunk/PARPG
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/maps/shanty.xml

    r139 r140  
    1010    <import file="../objects/ground/walls/wall_rear/wall-top.xml"></import> 
    1111    <import file="../objects/ground/walls/wall_rear/wall-right.xml"></import> 
     12    <import file="../objects/ground/walls/wall_rear/wall-left.xml"></import> 
    1213    <import file="../objects/ground/walls/wall_front/wall-up.xml"></import> 
    1314    <import file="../objects/ground/walls/wall_front/wall-down.xml"></import> 
     15    <import file="../objects/ground/walls/wall_front/wall-bottom.xml"></import> 
    1416    <import file="../objects/ground/block/block.xml"></import> 
    1517    <import file="../objects/ground/doors/floor.xml"></import> 
     
    7678                <instances> 
    7779                    <!-- Some objects are just plain visual aids --> 
     80                    <i x="-3.0" y="-3.0" z="0.0" r="0" o="wall-rear-left"></i> 
    7881            <i x="-2.0" y="-3.0" z="0.0" r="0" o="wall-rear-up"></i> 
    7982            <i x="-1.0" y="-3.0" z="0.0" r="0" o="wall-rear-up"></i> 
     
    8891            <i x="4.0" y="1.0" z="0.0" r="0" o="wall-rear-down"></i> 
    8992            <i x="4.0" y="2.0" z="0.0" r="0" o="wall-rear-right"></i> 
    90  
    9193            <i x="4.0" y="-3.0" z="0.0" r="0" o="wall-rear-top"></i> 
    9294 
     
    101103            <i x="-3.0" y="0.0" z="0.0" r="0" o="wall-front-down"></i> 
    102104            <i x="-3.0" y="1.0" z="0.0" r="0" o="wall-front-down"></i> 
     105            <i x="-3.0" y="2.0" z="0.0" r="0" o="wall-front-bottom"></i> 
    103106                </instances> 
    104107        </layer> 
  • trunk/PARPG/scripts/sounds.py

    r135 r140  
    2626        self.music = self.sound_engine.createEmitter() 
    2727        self.music_on = False 
     28        self.music_init = False 
    2829     
    2930    def playMusic(self, sfile = None): 
     
    3334            self.music.setSoundClip(sound) 
    3435            self.music.setLooping(True) 
     36            self.music_init = True 
    3537        self.music.play() 
    3638        self.music_on = True 
    37      
     39 
    3840    def pauseMusic(self): 
    3941        """Stop current playback""" 
    40         self.music.pause() 
    41         self.music_on = False 
     42        if(self.music_init == True): 
     43            self.music.pause() 
     44            self.music_on = False 
    4245 
    4346    def toggleMusic(self): 
    44         if(self.music_on == False): 
     47        if((self.music_on == False)and(self.music_init == True)): 
    4548            self.playMusic() 
    4649        else: 
  • trunk/PARPG/scripts/world.py

    r137 r140  
    8484        # TODO: I'm killing the PC now, but later we will have to save the PC 
    8585        if self.map: 
    86              
    87             print "number=",self.model.getNamespaces() 
    88              
    8986            self.model.deleteObjects() 
    9087            self.model.deleteMap(self.map) 
     
    104101           is subject to change""" 
    105102        self.reset() 
    106  
     103        # some messy code to handle music changes when we enter a new map 
     104        if(self.sounds.music_on == True): 
     105            self.sounds.pauseMusic() 
     106            unpause = True 
     107        else: 
     108            unpause = False 
    107109        self.map = loadMapFile(filename, self.engine) 
    108110        self.maplistener = Map(self.map) 
    109  
    110111        # there must be a PC object on the objects layer! 
    111112        self.agent_layer = self.map.getLayer('ObjectLayer') 
     
    132133        # start playing the music 
    133134        # TODO: remove hard coding by putting this in the level data 
    134         self.sounds.playMusic("/music/preciouswasteland.ogg") 
     135        # don't force restart if skipping to new section 
     136        if(self.sounds.music_init == False): 
     137            self.sounds.playMusic("/music/preciouswasteland.ogg") 
     138        elif(unpause == True): 
     139            self.sounds.playMusic() 
    135140 
    136141    def addPC(self, agent): 
Note: See TracChangeset for help on using the changeset viewer.