Mercurial > fife-parpg
changeset 523:d01eb65b2726
Enabling the FloatingTextRenderer for the RPG demo. The NPC now complains at you if he doesn't have a quest to give you.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 27 May 2010 18:29:20 +0000 |
parents | 7b451e3b2439 |
children | 6037f79b0dcf |
files | demos/rpg/scripts/actors/baseactor.py demos/rpg/scripts/gamecontroller.py demos/rpg/scripts/scene.py |
diffstat | 3 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/demos/rpg/scripts/actors/baseactor.py Thu May 27 18:26:11 2010 +0000 +++ b/demos/rpg/scripts/actors/baseactor.py Thu May 27 18:29:20 2010 +0000 @@ -59,6 +59,8 @@ self._dest.offerNextQuest() else: self._dest.completeQuest() + else: + self._dest.instance.say("I've got nothing for you... leave me alone.", 2500) ActorStates = {'STAND':0, 'WALK':1,
--- a/demos/rpg/scripts/gamecontroller.py Thu May 27 18:26:11 2010 +0000 +++ b/demos/rpg/scripts/gamecontroller.py Thu May 27 18:29:20 2010 +0000 @@ -167,7 +167,8 @@ self._scene = None self._instancerenderer = None - + self._floatingtextrenderer = None + def onConsoleCommand(self, command): """ Might be useful if you want to have the game parse a command. @@ -191,6 +192,8 @@ self._scene.createScene(self._settings.get("RPG", "TownMapFile", "maps/town.xml")) self._instancerenderer = fife.InstanceRenderer.getInstance(self._scene.cameras[self._settings.get("RPG", "DefaultCameraName", "camera1")]) + self._floatingtextrenderer = fife.FloatingTextRenderer.getInstance(self._scene.cameras[self._settings.get("RPG", "DefaultCameraName", "camera1")]) + self._floatingtextrenderer.addActiveLayer(self._scene.actorlayer) #start listening to events self._listener.attach() @@ -200,6 +203,7 @@ self._scene.destroyScene() self._scene = None self._instancerenderer = None + self._floatingtextrenderer = None def quit(self): self.endGame()
--- a/demos/rpg/scripts/scene.py Thu May 27 18:26:11 2010 +0000 +++ b/demos/rpg/scripts/scene.py Thu May 27 18:29:20 2010 +0000 @@ -133,8 +133,12 @@ def _getObjectList(self): return self._objectlist + def _getMap(self): + return self._map + actorlayer = property(_getActorLayer) cameras = property(_getCameras) player = property(_getPlayer) objectlist = property(_getObjectList) + map = property(_getMap)