Changeset 342:11febdb72296 for nagslang


Ignore:
Timestamp:
Sep 6, 2013, 10:59:51 AM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

Resume from the previous level

Location:
nagslang
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r340 r342  
    172172                self._disable_render = True
    173173                self.world.rooms += 1
     174                self.world.level = ev.destination
    174175                ScreenChange.post(ev.destination)
    175176                return
  • nagslang/screens/menu.py

    r325 r342  
    55from nagslang.screens.base import Screen
    66from nagslang.events import QuitEvent, ScreenChange
    7 from nagslang.level import Level
    87from nagslang.widgets.text import TextWidget, MultiLineWidget
    98
     
    4847
    4948    def play(self):
    50         first_level = Level.list_levels()[0]
    51         ScreenChange.post(first_level)
     49        ScreenChange.post(self.world.level)
    5250
    5351    def restart(self):
  • nagslang/world.py

    r307 r342  
    88import pymunk
    99
     10from nagslang.level import Level
     11from nagslang.protagonist import Protagonist
    1012from nagslang.yamlish import dump, load
    11 from nagslang.protagonist import Protagonist
    1213
    1314
     
    2324        self.rooms = 0
    2425        self.protagonist = Protagonist(pymunk.Space(), self, (350, 300))
     26        first_level = Level.list_levels()[0]
     27        self.level = first_level
    2528
    2629    def _save_location(self):
Note: See TracChangeset for help on using the changeset viewer.