Mercurial > fife-parpg
diff demos/shooter/scripts/ships/shipbase.py @ 492:16ceb3228324
Moved the SoundManager and the 2D math function (helpers) from the shooter demo to the fife extensions.
Fixed fife_timer as it didn't work in the first place. Modified the SoundManager to use the now working fife_timer and removed the Timer class from the shooter demo entirely
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 07 May 2010 21:07:27 +0000 |
parents | c4168eb47a44 |
children | e241d7553496 |
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/shipbase.py Thu May 06 19:34:21 2010 +0000 +++ b/demos/shooter/scripts/ships/shipbase.py Fri May 07 21:07:27 2010 +0000 @@ -86,8 +86,8 @@ self._hitpoints = 0 self._scorevalue = 0 - self._hitclip = self._scene.soundmanager.loadSoundClip("sounds/hit.ogg") - self._explodclip = self._scene.soundmanager.loadSoundClip("sounds/explode.ogg") + self._hitclip = self._scene.soundmanager.createSoundEmitter("sounds/hit.ogg") + self._explodclip = self._scene.soundmanager.createSoundEmitter("sounds/explode.ogg") def _setWeapon(self, weapon): self._weapon = weapon @@ -127,7 +127,7 @@ if self._hitpoints <= 0: self.destroy() else: - self._scene.soundmanager.playClip(self._hitclip) + self._hitclip.play() def destroy(self): """ @@ -135,7 +135,7 @@ """ if self._running: self._instance.act('explode', self._instance.getFacingLocation()) - self._scene.soundmanager.playClip(self._explodclip) + self._explodclip.play() super(Ship, self).destroy() def _getHitPoints(self):