diff demos/shooter/scripts/world.py @ 480:85fa5fa486a8

Added a simple sound manager. Added music to the level.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 28 Apr 2010 17:28:29 +0000
parents afde89c1d50b
children 939a4dc12ca1
line wrap: on
line diff
--- a/demos/shooter/scripts/world.py	Fri Apr 23 17:17:02 2010 +0000
+++ b/demos/shooter/scripts/world.py	Wed Apr 28 17:28:29 2010 +0000
@@ -36,6 +36,7 @@
 from scripts.ships.shipbase import Ship
 from scripts.ships.player import Player
 from scripts.scene import Scene
+from scripts.soundmanager import SoundManager
 
 class World(EventListenerBase):
 	"""
@@ -64,6 +65,8 @@
 		self._pausedtime = 0
 		self._starttime = 0
 		
+		self._soundmanager = SoundManager(self._engine)
+		
 		self._mainmenu = MainMenu(self)
 		self.showMainMenu()
 		
@@ -103,6 +106,7 @@
 		
 	def quit(self):
 		self.reset()
+		self._soundmanager.destroy()
 		self._applictaion.requestQuit()
 		
 	def reset(self):
@@ -129,7 +133,7 @@
 		self.reset()
 		self._map = loadMapFile(self._filename, self._engine)
 
-		self._scene = Scene(self, self._engine, self._map.getLayer('objects'))
+		self._scene = Scene(self, self._engine, self._map.getLayer('objects'), self._soundmanager)
 		self._scene.initScene(self._map)
 
 		self.initCameras()