Changeset 63


Ignore:
Timestamp:
05/12/09 16:22:57 (10 years ago)
Author:
bretzel_parpg
Message:

Integrated the inventory into the PARPG demo.
Press I to show/hide the inventory.

Location:
trunk/PARPG
Files:
16 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/README

    r60 r63  
    1717    T shows the grid layout. 
    1818    Q quits. 
     19    I shows/hides inventory. 
    1920 
    2021It should be noted that PARPG is in no way a complete game as of yet. 
  • trunk/PARPG/scripts/world.py

    r62 r63  
    2323from agents.npc import NPC 
    2424from settings import Setting 
     25from scripts import inventory 
    2526 
    2627TDS = Setting() 
     
    6465        self.view=self.engine.getView() 
    6566        self.quitFunction=None 
     67        self.inventoryShown = False 
     68        self.firstInventory = True 
    6669        self.mouseCallback=None 
    6770 
     
    141144            t="screenshots/screen-%s.png" % date.today().strftime('%Y-%m-%d') 
    142145            self.engine.getRenderBackend().captureScreen(t) 
     146        if(keyval==key.I): 
     147            # show the inventory 
     148            if (self.firstInventory == True): 
     149                self.inventory = inventory.Inventory(self.engine) 
     150                self.firstInventory = False 
     151                self.inventoryShown = True 
     152 
     153            elif ((self.firstInventory == False) and  
     154                  (self.inventoryShown == True)): 
     155                self.inventory.closeInventory() 
     156                self.inventoryShown = False 
     157 
     158            elif ((self.firstInventory == False) and 
     159                  (self.inventoryShown == False)): 
     160                self.inventory.showInventory() 
     161                self.inventoryShown = True 
    143162 
    144163    def mousePressed(self, evt): 
Note: See TracChangeset for help on using the changeset viewer.