diff gamelib/scenes/mess.py @ 570:9c3528c2cbe5 pyntnclick

Bug fixes for sound hook-up.
author Simon Cross <hodgestar+bzr@gmail.com>
date Sat, 11 Feb 2012 15:48:06 +0200
parents ea9dd2b9186a
children 1b1ab71535bd
line wrap: on
line diff
--- a/gamelib/scenes/mess.py	Sat Feb 11 15:40:40 2012 +0200
+++ b/gamelib/scenes/mess.py	Sat Feb 11 15:48:06 2012 +0200
@@ -258,14 +258,11 @@
 
     HISS = 'boomslang.ogg'
 
-    def __init__(self, state):
-        super(Boomslang, self).__init__(state)
-        self.hiss = self.sound.get_sound(self.HISS)
-
     def is_interactive(self, tool=None):
         return False
 
     def animate(self):
+        hiss = self.state.sound.get_sound(self.HISS)
         if self.get_data('anim_pos') > -1:
             self.current_interact.animate()
             if self.get_data('anim_pos') > self.current_interact._anim_pos:
@@ -277,7 +274,7 @@
         if randint(0, 30 * constants.FRAME_RATE) == 0:
             self.set_interact('snake')
             self.set_data('anim_pos', 0)
-            self.hiss.play()
+            hiss.play()
         return False