diff demos/rpg/scripts/gamecontroller.py @ 517:c3a026cdd91b

Added the BaseGameObject class and put it in it's own file. All game object will inherit it. Added instance action listeners.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 26 May 2010 15:28:25 +0000
parents d70fc46c8aa5
children 14f777be6b94
line wrap: on
line diff
--- a/demos/rpg/scripts/gamecontroller.py	Tue May 25 21:41:59 2010 +0000
+++ b/demos/rpg/scripts/gamecontroller.py	Wed May 26 15:28:25 2010 +0000
@@ -28,9 +28,12 @@
 
 from fife import fife
 
+from fife.extensions.soundmanager import SoundManager
+from fife.extensions.loaders import loadImportFile
+
 from scripts.scene import Scene
 from scripts.guicontroller import GUIController
-from fife.extensions.loaders import loadImportFile
+
 
 class KeyState(object):
 	def __init__(self):
@@ -54,6 +57,7 @@
 		self._gamecontroller = gamecontroller
 		self._settings = gamecontroller.settings
 		self._eventmanager = self._engine.getEventManager()
+		self._soundmanager = SoundManager(self._engine)
 		
 		fife.IMouseListener.__init__(self)
 		fife.IKeyListener.__init__(self)
@@ -101,24 +105,29 @@
 			return
 
 		pt = fife.ScreenPoint(event.getX(), event.getY())
-		instances = self.getInstancesAt(pt);
+		instances = self._gamecontroller.scene.getInstancesAt(pt);
+
 		for i in instances:
 			renderer.addOutlined(i, 173, 255, 47, 2)
 
 	def mouseEntered(self, event):
 		pass
+		
 	def mouseExited(self, event):
 		pass
+		
 	def mouseClicked(self, event):
 		pass
+		
 	def mouseWheelMovedUp(self, event):
 		pass	
+		
 	def mouseWheelMovedDown(self, event):
 		pass
-	def mouseMoved(self, event):
-		pass
+		
 	def mouseDragged(self, event):
 		pass
+		
 	def keyPressed(self, event):
 		keyval = event.getKey().getValue()
 		keystr = event.getKey().getAsString().lower()