Rev | Line | |
---|
[238] | 1 | # The world object
|
---|
| 2 | #
|
---|
| 3 | # This is a global object for tracking state across scenes and all that
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | class 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.