Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
482:16c2b3ee59ce | 483:82d44c471959 |
---|---|
175 self._nodes[nodeindex].spaceobjects.append(powerup) | 175 self._nodes[nodeindex].spaceobjects.append(powerup) |
176 | 176 |
177 #and finally add the player to the scene | 177 #and finally add the player to the scene |
178 self.addObjectToScene(self._player) | 178 self.addObjectToScene(self._player) |
179 | 179 |
180 self._music = self._soundmanager.createSoundEmitter("music/waynesmind2.ogg") | 180 self._music = self._soundmanager.loadSoundClip("music/waynesmind2.ogg") |
181 self._music.play(True) | 181 self._music.looping = True |
182 self._soundmanager.playClip(self._music) | |
182 | 183 |
183 self.startCamera() | 184 self.startCamera() |
184 | 185 |
185 def pause(self, time): | 186 def pause(self, time): |
186 self._pausedtime = time | 187 self._pausedtime = time |
193 def playerHit(self, damage): | 194 def playerHit(self, damage): |
194 self._player.applyHit(damage) | 195 self._player.applyHit(damage) |
195 | 196 |
196 def gameOver(self): | 197 def gameOver(self): |
197 self._gameover = True | 198 self._gameover = True |
198 self._music.stop() | 199 self._soundmanager.stopClip(self._music) |
199 self._world.gameOver() | 200 self._world.gameOver() |
200 | 201 |
201 def endLevel(self): | 202 def endLevel(self): |
202 self._music.stop() | 203 self._soundmanager.stopClip(self._music) |
203 self._world.endLevel() | 204 self._world.endLevel() |
204 | 205 |
205 def queueObjectForRemoval(self, obj): | 206 def queueObjectForRemoval(self, obj): |
206 self._objectstodelete.append(obj) | 207 self._objectstodelete.append(obj) |
207 | 208 |
381 def _getTimeDelta(self): | 382 def _getTimeDelta(self): |
382 return self._timedelta | 383 return self._timedelta |
383 | 384 |
384 def _getPaused(self): | 385 def _getPaused(self): |
385 return self._paused | 386 return self._paused |
386 | 387 |
388 def _getSoundManager(self): | |
389 return self._soundmanager | |
390 | |
387 player = property(_getPlayer) | 391 player = property(_getPlayer) |
388 keystate = property(_getKeyState) | 392 keystate = property(_getKeyState) |
389 camera = property(_getCamera) | 393 camera = property(_getCamera) |
390 objectlayer = property(_getObjectLayer) | 394 objectlayer = property(_getObjectLayer) |
391 model = property(_getModel) | 395 model = property(_getModel) |
392 time = property(_getTime) | 396 time = property(_getTime) |
393 timedelta = property(_getTimeDelta) | 397 timedelta = property(_getTimeDelta) |
394 paused = property(_getPaused) | 398 paused = property(_getPaused) |
399 soundmanager = property(_getSoundManager) |