changeset 375:83c29d0a0b9c

Count deaths
author Stefano Rivera <stefano@rivera.za.net>
date Fri, 06 Sep 2013 22:52:24 +0200
parents 150332d6c1fb
children e55a338b58e7
files nagslang/protagonist.py nagslang/world.py
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nagslang/protagonist.py	Fri Sep 06 22:44:14 2013 +0200
+++ b/nagslang/protagonist.py	Fri Sep 06 22:52:24 2013 +0200
@@ -342,6 +342,7 @@
     def die(self):
         # Handle player death - may be called due to other reasons
         # than zero health
+        self.world.deaths += 1
         ScreenChange.post('dead')
 
     def lose_health(self, amount):
--- a/nagslang/world.py	Fri Sep 06 22:44:14 2013 +0200
+++ b/nagslang/world.py	Fri Sep 06 22:52:24 2013 +0200
@@ -22,6 +22,7 @@
         starting_position = (350, 300)
         self.__dict__['_data'] = {
             'attacks': 0,
+            'deaths': 0,
             'transformations': 0,
             'kills': 0,
             'rooms': 0,