Mercurial > pyntnclick
comparison 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 |
comparison
equal
deleted
inserted
replaced
569:0587f11ff435 | 570:9c3528c2cbe5 |
---|---|
256 'anim_pos': -1, | 256 'anim_pos': -1, |
257 } | 257 } |
258 | 258 |
259 HISS = 'boomslang.ogg' | 259 HISS = 'boomslang.ogg' |
260 | 260 |
261 def __init__(self, state): | |
262 super(Boomslang, self).__init__(state) | |
263 self.hiss = self.sound.get_sound(self.HISS) | |
264 | |
265 def is_interactive(self, tool=None): | 261 def is_interactive(self, tool=None): |
266 return False | 262 return False |
267 | 263 |
268 def animate(self): | 264 def animate(self): |
265 hiss = self.state.sound.get_sound(self.HISS) | |
269 if self.get_data('anim_pos') > -1: | 266 if self.get_data('anim_pos') > -1: |
270 self.current_interact.animate() | 267 self.current_interact.animate() |
271 if self.get_data('anim_pos') > self.current_interact._anim_pos: | 268 if self.get_data('anim_pos') > self.current_interact._anim_pos: |
272 self.set_interact('no_snake') | 269 self.set_interact('no_snake') |
273 self.set_data('anim_pos', -1) | 270 self.set_data('anim_pos', -1) |
275 self.set_data('anim_pos', self.current_interact._anim_pos) | 272 self.set_data('anim_pos', self.current_interact._anim_pos) |
276 return True | 273 return True |
277 if randint(0, 30 * constants.FRAME_RATE) == 0: | 274 if randint(0, 30 * constants.FRAME_RATE) == 0: |
278 self.set_interact('snake') | 275 self.set_interact('snake') |
279 self.set_data('anim_pos', 0) | 276 self.set_data('anim_pos', 0) |
280 self.hiss.play() | 277 hiss.play() |
281 return False | 278 return False |
282 | 279 |
283 | 280 |
284 class DetergentThing(Thing): | 281 class DetergentThing(Thing): |
285 | 282 |