diff demos/shooter/scripts/scene.py @ 483:82d44c471959

Modified the SoundManager to not create unique FIFE sound emitters for each object. There is now only one FIFE emitter per unique sound. Added some sound effects.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 29 Apr 2010 16:09:56 +0000
parents 1f37adc9a685
children d365eb58f3d6
line wrap: on
line diff
--- a/demos/shooter/scripts/scene.py	Thu Apr 29 13:51:45 2010 +0000
+++ b/demos/shooter/scripts/scene.py	Thu Apr 29 16:09:56 2010 +0000
@@ -177,8 +177,9 @@
 		#and finally add the player to the scene
 		self.addObjectToScene(self._player)
 		
-		self._music = self._soundmanager.createSoundEmitter("music/waynesmind2.ogg")
-		self._music.play(True)
+		self._music = self._soundmanager.loadSoundClip("music/waynesmind2.ogg")
+		self._music.looping = True
+		self._soundmanager.playClip(self._music)
 		
 		self.startCamera()
 		
@@ -195,11 +196,11 @@
 		
 	def gameOver(self):
 		self._gameover = True
-		self._music.stop()		
+		self._soundmanager.stopClip(self._music)		
 		self._world.gameOver()
 		
 	def endLevel(self):
-		self._music.stop()
+		self._soundmanager.stopClip(self._music)
 		self._world.endLevel()
 		
 	def queueObjectForRemoval(self, obj):
@@ -383,7 +384,10 @@
 		
 	def _getPaused(self):
 		return self._paused
-		
+
+	def _getSoundManager(self):
+		return self._soundmanager
+	
 	player = property(_getPlayer)
 	keystate = property(_getKeyState)
 	camera = property(_getCamera)
@@ -391,4 +395,5 @@
 	model = property(_getModel)
 	time = property(_getTime)
 	timedelta = property(_getTimeDelta)
-	paused = property(_getPaused)	
+	paused = property(_getPaused)
+	soundmanager = property(_getSoundManager)