diff pytouhou/games/eosd.py @ 379:e0e284fcb288

Make a sound when an enemy is hit.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 30 Aug 2012 11:34:56 +0200
parents a5595de3fe7e
children 690b5faaa0e6
line wrap: on
line diff
--- a/pytouhou/games/eosd.py
+++ b/pytouhou/games/eosd.py
@@ -194,10 +194,13 @@ class EoSDInterface(object):
                 timeout_label.set_color('blue')
             elif timeout >= 10:
                 timeout_label.set_color('darkblue')
-            elif timeout >= 5:
-                timeout_label.set_color('purple')
             else:
-                timeout_label.set_color('red')
+                if timeout >= 5:
+                    timeout_label.set_color('purple')
+                else:
+                    timeout_label.set_color('red')
+                if (boss.timeout - boss.frame) % 60 == 0 and boss.timeout != 0:
+                    self.game.sfx_player.play('timeout.wav', volume=1.)
             timeout_label.set_text('%02d' % (timeout if timeout >= 0 else 0))
             timeout_label.changed = True