Ignore:
Timestamp:
09/02/13 21:05:25 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Load game objects from level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r143 r145  
    6969        self.keys = ControlKeys()
    7070        self._level = Level(self.name)
    71         self._level.load()
     71        self._level.load(self.space)
    7272        self._drawables = Drawables()
    7373        self.add_walls()
    7474        self.add_protagonist()
    75         self._setup_demo_objects()
     75        self.add_game_objects()
     76        # self._setup_demo_objects()
    7677
    7778    def _setup_demo_objects(self):
     
    8384        light2 = FloorLight(self.space, (250, 500), 'both_switches')
    8485        light2.zorder = ZORDER_HIGH
    85         glue.add_component('switch', switch.puzzler)
    86         glue.add_component('switch2', switch2.puzzler)
    87         glue.add_component('light', light.puzzler)
    88         glue.add_component('light2', light2.puzzler)
     86        glue.add_component('switch', switch)
     87        glue.add_component('switch2', switch2)
     88        glue.add_component('light', light)
     89        glue.add_component('light2', light2)
    8990        glue.add_component(
    9091            'both_switches', StateLogicalAndPuzzler('switch', 'switch2'))
     
    110111                corner = next_corner
    111112        self.space.add(*self.walls)
     113
     114    def add_game_objects(self):
     115        for drawable in self._level.get_drawables():
     116            self._drawables.add(drawable)
    112117
    113118    def add_protagonist(self):
Note: See TracChangeset for help on using the changeset viewer.