source: nagslang/world.py@ 247:70d696b82399

Last change on this file since 247:70d696b82399 was 238:28d906fc2ab1, checked in by Neil Muller <drnlmuller@…>, 8 years ago

Add a world object to collect some stats

File size: 566 bytes
Line 
1# The world object
2#
3# This is a global object for tracking state across scenes and all that
4
5
6class World(object):
7
8 def __init__(self):
9 self.transformations = 0
10 self.kills = 0
11 self.rooms = 0
12
13 def save(self):
14 # TODO: Do this
15 pass
16
17 def load(self):
18 # TODO: Do this
19 pass
20
21 def get_formatted_stats(self):
22 return "\n".join([
23 "Times transformed: %d" % self.transformations,
24 "Enemies killed: %d" % self.kills,
25 "Rooms entered: %d" % self.rooms
26 ])
Note: See TracBrowser for help on using the repository browser.