diff pyntnclick/engine.py @ 629:660ef5793886 pyntnclick

Remove albow from sound
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 11 Feb 2012 22:20:26 +0200
parents d9d1a9c4b833
children fdc63049b08c
line wrap: on
line diff
--- a/pyntnclick/engine.py	Sat Feb 11 22:16:43 2012 +0200
+++ b/pyntnclick/engine.py	Sat Feb 11 22:20:26 2012 +0200
@@ -6,6 +6,11 @@
 import pygame.time
 from pygame.locals import QUIT, USEREVENT
 
+# We can't do this via our usual UserEvent trickey
+# as it gets generated by pygame.music, which only
+# takes an event type
+MUSIC_ENDED = USEREVENT + 1
+
 
 class Engine(object):
     def __init__(self, game_description):
@@ -34,6 +39,8 @@
             for ev in events:
                 if ev.type == QUIT:
                     return
+                elif ev.type == MUSIC_ENDED:
+                    self._game_description.sound.music_ended()
                 elif ScreenChangeEvent.matches(ev):
                     self.set_screen(ev.screen_name)
                 elif ScreenEvent.matches(ev):