# HG changeset patch # User Simon Cross # Date 1282492354 -7200 # Node ID 8e709824306dc200253e5e80d14ef24a5483c31f # Parent 4810fd976051fdec1f75219aacc89a3af3ed1274 Add items and things. diff -r 4810fd976051 -r 8e709824306d gamelib/state.py --- a/gamelib/state.py Sun Aug 22 17:21:46 2010 +0200 +++ b/gamelib/state.py Sun Aug 22 17:52:34 2010 +0200 @@ -24,28 +24,45 @@ self.scenes = {} # map of item name -> Item object self.items = {} + # map of item name -> Item object in inventory + self.inventory = {} class Scene(object): """Base class for scenes.""" + FOLDER = None + BACKGROUND = None + def __init__(self): - pass + # map of thing names -> Thing objects + self.things = {} + self._background = get_image([self.FOLDER, self.BACKGROUND]) - def draw_background(self, screen): + def draw_background(self, surface): pass - def draw_sprites(self, screen): + def draw_sprites(self, surface): pass - def draw(self, screen): - self.draw_background(screen) - self.draw_sprites(screen) + def draw(self, surface): + self.draw_background(surface) + self.draw_sprites(surface) -class Item(object): - """Base class for items.""" +class Thing(object): + """Base class for things in a scene that you can interact with.""" def __init__(self): pass + def interact(self, item): + pass + + +class Item(object): + """Base class for inventory items.""" + + def __init__(self): + pass +