Mercurial > pyntnclick
comparison 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 |
comparison
equal
deleted
inserted
replaced
106:da547e148532 | 107:5213b45fcc7e |
---|---|
1 """Utilities and base classes for dealing with scenes.""" | 1 """Utilities and base classes for dealing with scenes.""" |
2 | 2 |
3 from albow.resource import get_image, get_sound | 3 from albow.resource import get_image |
4 from albow.utils import frame_rect | 4 from albow.utils import frame_rect |
5 from widgets import BoomLabel | 5 from widgets import BoomLabel |
6 from pygame.locals import BLEND_ADD | 6 from pygame.locals import BLEND_ADD |
7 from pygame.rect import Rect | 7 from pygame.rect import Rect |
8 from pygame.color import Color | 8 from pygame.color import Color |
9 | 9 |
10 import constants | 10 import constants |
11 from sound import get_sound | |
11 | 12 |
12 class Result(object): | 13 class Result(object): |
13 """Result of interacting with a thing""" | 14 """Result of interacting with a thing""" |
14 | 15 |
15 def __init__(self, message=None): | 16 def __init__(self, message=None, soundfile=None): |
16 self.message = message | 17 self.message = message |
18 self.sound = None | |
19 if soundfile: | |
20 self.sound = get_sound(soundfile) | |
17 | 21 |
18 | 22 |
19 def initial_state(): | 23 def initial_state(): |
20 """Load the initial state.""" | 24 """Load the initial state.""" |
21 state = State() | 25 state = State() |