Mercurial > boomslang
view gamelib/statehelpers.py @ 239:366c8fe16697
Fix reference to tin pipe.
author | Simon Cross <hodgestar+bzr@gmail.com> |
---|---|
date | Fri, 27 Aug 2010 09:57:47 +0200 |
parents | 5cb3fbe61f75 |
children |
line wrap: on
line source
"""Set of utility classes for common state things""" from pygame.color import Color from pygame.colordict import THECOLORS from gamelib.state import Thing, Result, \ InteractImage, InteractNoImage, InteractRectUnion, \ InteractAnimated from gamelib.constants import DEBUG class GenericDescThing(Thing): "Thing with an InteractiveUnionRect and a description" INITIAL = "description" def __init__(self, prefix, number, description, areas): super(GenericDescThing, self).__init__() self.description = description self.name = '%s.%s' % (prefix, number) self.interacts = { 'description' : InteractRectUnion(areas) } if DEBUG: # Individual colors to make debugging easier self._interact_hilight_color = Color(THECOLORS.keys()[number]) def get_description(self): return self.description