Changeset 238:28d906fc2ab1 for nagslang


Ignore:
Timestamp:
Sep 4, 2013, 8:07:20 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Children:
239:30137dc83a72, 244:93a20b51963f
Message:

Add a world object to collect some stats

Location:
nagslang
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • nagslang/engine.py

    r180 r238  
    88from nagslang.screens.area import AreaScreen
    99from nagslang.events import ScreenChange
     10from nagslang.world import World
    1011
    1112
     
    1617        self._fps = constants.FPS
    1718        self._dt = 1. / self._fps
    18         self._world = None  # TODO: create the world
     19        self._world = World()
    1920        self._current_screen = None
    2021        self._screens = {
  • nagslang/screens/area.py

    r211 r238  
    127127            if ev.key == pygame.locals.K_c:
    128128                self.protagonist.toggle_form()
     129                self.world.transformations += 1
    129130        elif DoorEvent.matches(ev):
    130131            self.protagonist.set_position(ev.dest_pos)
     
    132133                # Go to anther screen
    133134                self._disable_render = True
     135                self.world.rooms += 1
    134136                ScreenChange.post(ev.destination, self.protagonist)
    135137                return
  • nagslang/screens/menu.py

    r226 r238  
    55from nagslang.screens.base import Screen
    66from nagslang.events import QuitEvent, ScreenChange
    7 from nagslang.widgets.text import TextWidget
     7from nagslang.widgets.text import TextWidget, MultiLineWidget
    88
    99
     
    2424            TextWidget((40, 70), 'Restore saved game'),
    2525            TextWidget((40, 90), 'Quit'),
     26            MultiLineWidget((60, 120), self.world.get_formatted_stats()),
    2627            self.cursor,
    2728        ]
Note: See TracChangeset for help on using the changeset viewer.