Mercurial > fife-parpg
diff demos/shooter/scripts/ships/shipbase.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 | 6b33d80b468b |
children | c4168eb47a44 |
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/shipbase.py Thu Apr 29 13:51:45 2010 +0000 +++ b/demos/shooter/scripts/ships/shipbase.py Thu Apr 29 16:09:56 2010 +0000 @@ -58,6 +58,9 @@ self._hitpoints = 0 self._scorevalue = 0 + + self._hitclip = self._scene.soundmanager.loadSoundClip("sounds/hit.ogg") + self._explodclip = self._scene.soundmanager.loadSoundClip("sounds/explode.ogg") def _setWeapon(self, weapon): self._weapon = weapon @@ -81,10 +84,13 @@ self._hitpoints -= hp if self._hitpoints <= 0: self.destroy() + else: + self._scene.soundmanager.playClip(self._hitclip) def destroy(self): if self._running: self._instance.act('explode', self._instance.getFacingLocation()) + self._scene.soundmanager.playClip(self._explodclip) super(Ship, self).destroy() def _getHitPoints(self):