Ignore:
Timestamp:
Sep 6, 2013, 9:58:15 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
rebase_source:
5077a64a868295383cfa281f1f69c605a3d6437c
Message:

Use a result object to get new drawables back to the area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r371 r385  
    244244        self.tick_protagonist()
    245245        for drawable in self._drawables:
    246             drawable.update(seconds)
    247             if drawable.remove:
    248                 self._drawables.remove(drawable)
     246            result = drawable.update(seconds)
     247            if result is not None:
     248                for new_drawable in result.add:
     249                    self._drawables.add(new_drawable)
     250                for old_drawable in result.remove:
     251                    self._drawables.remove(old_drawable)
    249252
    250253    def render_health_bar(self, surface, damage_experienced=None):
Note: See TracChangeset for help on using the changeset viewer.