Changeset 295 for trunk/game
- Timestamp:
- 10/01/09 07:13:39 (10 years ago)
- Location:
- trunk/game/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/game/scripts/console.py
r281 r295 25 25 26 26 self.commands = [ 27 {"cmd":"exit" ,"callback":self.handleQuit ,"help":"Terminate application"}, 28 {"cmd":"grid" ,"callback":self.handleGrid ,"help":"Toggle grid display "}, 29 {"cmd":"help" ,"callback":self.handleHelp ,"help":"Show this help string"}, 30 {"cmd":"load" ,"callback":self.handleLoad ,"help":"load directory file "}, 31 {"cmd":"python","callback":self.handlePython,"help":"Run some python code "}, 32 {"cmd":"quit" ,"callback":self.handleQuit ,"help":"Terminate application"}, 33 {"cmd":"save" ,"callback":self.handleSave ,"help":"save directory file "}, 27 {"cmd":"exit" ,"callback":self.handleQuit ,"help":"Terminate application "}, 28 {"cmd":"grid" ,"callback":self.handleGrid ,"help":"Toggle grid display "}, 29 {"cmd":"run" ,"callback":self.handleRun ,"help":"Toggle player run/walk"}, 30 {"cmd":"help" ,"callback":self.handleHelp ,"help":"Show this help string "}, 31 {"cmd":"load" ,"callback":self.handleLoad ,"help":"load directory file "}, 32 {"cmd":"python","callback":self.handlePython,"help":"Run some python code "}, 33 {"cmd":"quit" ,"callback":self.handleQuit ,"help":"Terminate application "}, 34 {"cmd":"save" ,"callback":self.handleSave ,"help":"save directory file "}, 34 35 ] 35 36 self.appListener=appListener … … 54 55 self.appListener.world.activeMap.toggle_renderer('GridRenderer') 55 56 return "Grid toggled" 57 58 def handleRun(self, command): 59 """ 60 Toggles run/walk mode of the PC player 61 @type command: string 62 @param command: The command to run. 63 @return: The response""" 64 65 if self.appListener.model.pc_run==1: 66 self.appListener.model.pc_run=0 67 return "PC is now walking" 68 else: 69 self.appListener.model.pc_run=1 70 return "PC is now running" 71 56 72 57 73 def handleHelp(self, command): … … 134 150 return result 135 151 152 136 153 def handleConsoleCommand(self, command): 137 154 """ -
trunk/game/scripts/engine.py
r287 r295 50 50 self.mapchange = False 51 51 self.gameState = GameState() 52 self.pc_run = 1 52 53 53 54 def reset(self): … … 261 262 @param position: Screen position of click 262 263 @return: None""" 263 self.gameState.PC.run(position) 264 if(self.pc_run==1): 265 self.gameState.PC.run(position) 266 else: 267 self.gameState.PC.walk(position) 264 268 265 269 def changeMap(self, map, targetPosition): -
trunk/game/scripts/objects/actors.py
r287 r295 122 122 123 123 def run(self, location): 124 """@type location: ??? 125 @param location: ??? 124 """Makes the PC run to a certain location 125 @type location: fife.ScreenPoint 126 @param location: Screen position to run to. 126 127 @return: None""" 127 128 self.state = _AGENT_STATE_RUN 128 self.behaviour.agent.move('run', location, self.behaviour.speed) 129 129 self.behaviour.agent.move('run', location, self.behaviour.speed+1) 130 131 def walk(self, location): 132 """Makes the PC walk to a certain location. 133 @type location: fife.ScreenPoint 134 @param location: Screen position to walk to. 135 @return: None""" 136 self.state = _AGENT_STATE_RUN 137 self.behaviour.agent.move('walk', location, self.behaviour.speed-1) 138 130 139 def approach(self, location, action = None): 131 140 """Approaches an npc and then ???.
Note: See TracChangeset
for help on using the changeset viewer.