Mercurial > pyntnclick
changeset 22:8e709824306d
Add items and things.
author | Simon Cross <hodgestar+bzr@gmail.com> |
---|---|
date | Sun, 22 Aug 2010 17:52:34 +0200 |
parents | 4810fd976051 |
children | 1e90a3e4618e |
files | gamelib/state.py |
diffstat | 1 files changed, 25 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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 +