Changeset 105:0131e4606e1a


Ignore:
Timestamp:
Sep 2, 2013, 11:29:30 AM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Message:

List of drawables in area.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r100 r105  
    5050        self._level = Level(self.name)
    5151        self._level.load()
     52        self._drawables = []
    5253        self.add_walls()
    5354        self.add_protagonist()
     55        # TODO: Put this in a level instead:
     56        self._drawables.append(FloorSwitch(self.space, (300, 400)))
    5457
    5558    def add_walls(self):
     
    7073    def add_protagonist(self):
    7174        self.protagonist = Protagonist(self.space, (350, 300))
    72         self.toy_switch = FloorSwitch(self.space, (300, 400))
     75        self._drawables.append(self.protagonist)
    7376
    7477    def handle_event(self, ev):
     
    105108        background = self._level.get_background()
    106109        mysurface = background.copy()
    107         self.toy_switch.render(mysurface)
    108         self.protagonist.render(mysurface)
     110        for drawable in self._drawables:
     111            drawable.render(mysurface)
    109112        render_rect = self._calc_viewport(mysurface, surface)
    110113        surface.blit(mysurface, (0, 0), render_rect)
Note: See TracChangeset for help on using the changeset viewer.