- for lvl, layer in self._layer_order:
- for actor in self._layers[layer]:
- actor.draw() # TODO: allow an option screen to be passed in
+ for lvl, name in self._ordered_layers:
+ for actor in self._layers[name]:
+ # actor.draw doesn't allow blitting to anything other than
+ # the game scene
+ screen.blit(actor._surf, actor.topleft)
+
+
+def defer_to_update(f):
+ """ Defers a function until the next update run. """
+ @functools.wraps(f)
+ def wrapper(self, *args, **kw):
+ self._deferred_updates.append((f, args, kw))
+ return wrapper