diff skaapsteker/sprites/base.py @ 210:9a6c711e2fdf

KILLhg statushg status
author Neil Muller <drnlmuller@gmail.com>
date Wed, 06 Apr 2011 23:48:09 +0200
parents 189f7f8ef714
children c5c4306593d8
line wrap: on
line diff
--- a/skaapsteker/sprites/base.py	Wed Apr 06 23:41:53 2011 +0200
+++ b/skaapsteker/sprites/base.py	Wed Apr 06 23:48:09 2011 +0200
@@ -52,6 +52,13 @@
         print "%s collided with player" % self
         player.damage(1)
 
+    def damage(self, damage):
+        print 'Damaged by ', damage
+        self.health -= damage
+        print 'Monster health', self.health
+        if self.health < 0:
+            self.kill()
+
 
 class NPC(GameSprite):