diff gamelib/state.py @ 107:5213b45fcc7e

Initial event sound support
author Neil Muller <neil@dip.sun.ac.za>
date Tue, 24 Aug 2010 14:07:07 +0200
parents 65976205fc2d
children 139864ce8bdb
line wrap: on
line diff
--- a/gamelib/state.py	Tue Aug 24 13:53:49 2010 +0200
+++ b/gamelib/state.py	Tue Aug 24 14:07:07 2010 +0200
@@ -1,6 +1,6 @@
 """Utilities and base classes for dealing with scenes."""
 
-from albow.resource import get_image, get_sound
+from albow.resource import get_image
 from albow.utils import frame_rect
 from widgets import BoomLabel
 from pygame.locals import BLEND_ADD
@@ -8,12 +8,16 @@
 from pygame.color import Color
 
 import constants
+from sound import get_sound
 
 class Result(object):
     """Result of interacting with a thing"""
 
-    def __init__(self, message=None):
+    def __init__(self, message=None, soundfile=None):
         self.message = message
+        self.sound = None
+        if soundfile:
+            self.sound = get_sound(soundfile)
 
 
 def initial_state():