# HG changeset patch # User Simon Cross # Date 1282493268 -7200 # Node ID 1e90a3e4618ea23cb8a58340eea231736e03203e # Parent 8e709824306dc200253e5e80d14ef24a5483c31f Add code for blitting Scene. diff -r 8e709824306d -r 1e90a3e4618e gamelib/state.py --- a/gamelib/state.py Sun Aug 22 17:52:34 2010 +0200 +++ b/gamelib/state.py Sun Aug 22 18:07:48 2010 +0200 @@ -1,7 +1,7 @@ """Utilities and base classes for dealing with scenes.""" from albow.resource import get_image, get_sound - +from pygame.locals import BLEND_ADD def initial_state(): """Load the initial state.""" @@ -40,14 +40,15 @@ self._background = get_image([self.FOLDER, self.BACKGROUND]) def draw_background(self, surface): - pass + surface.blit(self._background, (0, 0), None, BLEND_ADD) - def draw_sprites(self, surface): - pass + def draw_things(self, surface): + for thing in self.things.itervalues(): + thing.draw(surface) def draw(self, surface): self.draw_background(surface) - self.draw_sprites(surface) + self.draw_things(surface) class Thing(object): @@ -59,10 +60,14 @@ def interact(self, item): pass + def draw(self, surface): + pass + class Item(object): """Base class for inventory items.""" def __init__(self): pass + # needs cursor