diff demos/rpg/scripts/gamecontroller.py @ 519:14f777be6b94

Added a rudimentary Action class.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 27 May 2010 04:36:09 +0000
parents c3a026cdd91b
children b6bd314df28a
line wrap: on
line diff
--- a/demos/rpg/scripts/gamecontroller.py	Wed May 26 21:29:46 2010 +0000
+++ b/demos/rpg/scripts/gamecontroller.py	Thu May 27 04:36:09 2010 +0000
@@ -33,6 +33,7 @@
 
 from scripts.scene import Scene
 from scripts.guicontroller import GUIController
+from scripts.actors.baseactor import TalkAction
 
 
 class KeyState(object):
@@ -85,7 +86,9 @@
 		clickpoint = fife.ScreenPoint(event.getX(), event.getY())
 		if (event.getButton() == fife.MouseEvent.LEFT):
 			self._gamecontroller.scene.player.walk( self._gamecontroller.scene.getLocationAt(clickpoint) )
-			#self.hero.run( self.getLocationAt(clickpoint) )
+			instances = self._gamecontroller.scene.getInstancesAt(clickpoint)
+			if instances:
+				self._gamecontroller.scene.player.nextaction = TalkAction(self, self)
 
 		if (event.getButton() == fife.MouseEvent.RIGHT):
 			instances = self._gamecontroller.scene.getInstancesAt(clickpoint)