Mercurial > fife-parpg
diff demos/rpg/scripts/rpg.py @ 513:edf5c0cf52f3
Added the Actor and Player classes. Actor is the base class that the player and all enemies + NPCs will inherit.
Added a help file for the console.
Added a KeyState class for keeping track of the state of the keys.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 21 May 2010 20:33:43 +0000 |
parents | 6ddb1eb9dfa6 |
children | 65a92a2449d5 |
line wrap: on
line diff
--- a/demos/rpg/scripts/rpg.py Fri May 21 17:31:08 2010 +0000 +++ b/demos/rpg/scripts/rpg.py Fri May 21 20:33:43 2010 +0000 @@ -96,10 +96,10 @@ self.quit = True result = 'quitting' elif command.lower() in ( 'help', 'help()' ): - self._engine.getGuiManager().getConsole().println( open( 'misc/infotext.txt', 'r' ).read() ) - result = "-- End of help --" + helptextfile = self._gamecontroller.settings.get("RPG", "HelpText", "misc/help.txt") + self._engine.getGuiManager().getConsole().println( open( helptextfile, 'r' ).read() ) + result = "-OK-" else: - pass result = self._gamecontroller.onConsoleCommand(command) if not result: try: @@ -107,7 +107,7 @@ except: pass if not result: - result = 'no result' + result = 'Command Not Found...' return result def onToolsClick(self): @@ -139,5 +139,6 @@ def _pump(self): if self._listener.quit: self.breakRequested = True + self._gamecontroller.endGame() else: self._gamecontroller.pump()