Changeset 321:0d7885e2f063


Ignore:
Timestamp:
Sep 6, 2013, 12:03:16 AM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
rebase_source:
23a817ce082fe2b5f942972a12d8868d29b841e3
Message:

Add means for listing levels and areas.

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/level.py

    r317 r321  
    5656            'enemies': self._enemies,
    5757        }, f)
     58
     59    @classmethod
     60    def list_levels(cls):
     61        with resources.get_file('levels', 'LEVELS') as f:
     62            levels = load(f)
     63            return levels['levels']
    5864
    5965    def load(self, space):
  • nagslang/screens/area.py

    r319 r321  
    8383    def teardown(self):
    8484        sound.stop()
     85
     86    @classmethod
     87    def list_areas(self):
     88        return Level.list_levels()
    8589
    8690    def _player_collision_pre_solve_handler(self, space, arbiter):
Note: See TracChangeset for help on using the changeset viewer.