Changeset 134


Ignore:
Timestamp:
06/14/09 12:46:19 (10 years ago)
Author:
maximinus_parpg
Message:

Added basic SoundEngine? class.
Added new script sounds.py.
Plays background music.

Location:
trunk/PARPG
Files:
3 added
2 edited

Legend:

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

    r133 r134  
    173173                if(i.carry == True): 
    174174                    actions.append(("Pick Up",None)) 
    175                 return actions 
    176         return actions 
     175                #return actions 
     176        #return actions 
    177177 
    178178    def loadMap(self,map_file): 
  • trunk/PARPG/scripts/world.py

    r132 r134  
    2323from agents.hero import Hero 
    2424from agents.npc import NPC 
     25from sounds import SoundEngine 
    2526from settings import Setting 
    2627from scripts import inventory 
     
    7071        self.hud.main_menu.mapEvents(self.hud.menu_events) 
    7172        self.action_number = 1 
    72  
     73        # setup the inventory 
    7374        self.inventory = inventory.Inventory(self.engine, self.refreshReadyImages) 
    7475        self.inventory.events_to_map['close_button'] = self.closeInventoryAndToggle 
    7576        self.inventory.inventory.mapEvents(self.inventory.events_to_map) 
    7677        self.refreshReadyImages() 
     78        # init the sound (don't start playing yet) 
     79        self.sounds = SoundEngine(self.engine) 
    7780 
    7881    def reset(self): 
     
    127130                                                          0, str(TDS.readSetting("FontGlyphs", strip=False))) 
    128131        rend.changeDefaultFont(text) 
     132        # start playing the music 
     133        # TODO: remove hard coding by putting this in the level data 
     134        self.sounds.playMusic("/music/preciouswasteland.ogg") 
    129135 
    130136    def addPC(self, agent): 
     
    253259                            # there was a map change, don't screw with the GUI 
    254260                            return 
    255             if (hasattr(self, "context_menu")): 
     261            if(hasattr(self, "context_menu")): 
    256262                self.context_menu.vbox.hide() 
    257263                delattr(self, "context_menu") 
Note: See TracChangeset for help on using the changeset viewer.