Ignore:
Timestamp:
07/03/09 21:52:47 (11 years ago)
Author:
bretzel_parpg
Message:

When you press the open button on a crate, it now will move you to the crate and display a dialog with
9 slots to show the contents of the crate. The dialog will interface with the inventory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/agents/hero.py

    r180 r181  
    3939        self.speed = float(TDS.readSetting("PCSpeed")) 
    4040        self.engine = engine 
     41        self.atBox = False 
    4142         
    4243    def onNewMap(self, layer): 
     
    7273            # TODO: do something 
    7374            pass 
     75        if self.atBox == True: 
     76            self.engine.view.createBoxGUI() 
     77            self.atBox = False 
    7478        self.idle() 
    7579        if(action.getId() != 'stand'): 
     
    124128        self.agent.move('approachDoor', l, self.speed) 
    125129 
     130    def approachBox(self, location): 
     131        """ 
     132        Approach a box and then open it 
     133        @type location: list 
     134        @param locatation: list that is converted to a fife.Location 
     135        @return: None 
     136        """ 
     137        self.state = _STATE_RUN 
     138        boxLocation = tuple([int(float(i)) for i in location]) 
     139        l = fife.Location(self.agent.getLocation()) 
     140        l.setLayerCoordinates(fife.ModelCoordinate(*boxLocation)) 
     141        self.agent.move('run', l, self.speed) 
     142        self.atBox = True 
     143 
Note: See TracChangeset for help on using the changeset viewer.