# HG changeset patch # User Stefano Rivera # Date 1378420909 -7200 # Node ID fa408430a174850f56c2d19c6e22094c9e3d129e # Parent 2b0494b3ce6abb2be6fba2476ba9570e865b7ba2 Now *both* types of enemies die diff -r 2b0494b3ce6a -r fa408430a174 nagslang/enemies.py --- a/nagslang/enemies.py Fri Sep 06 00:41:14 2013 +0200 +++ b/nagslang/enemies.py Fri Sep 06 00:41:49 2013 +0200 @@ -51,12 +51,15 @@ def requires(cls): return [("name", "string"), ("position", "coordinates")] + def hit(self, weapon): + self.lose_health(weapon.damage) + def lose_health(self, amount): self.health -= amount if self.health < 0: self.physicser.remove_from_space() self.remove = True - EnemyDeathEvent.post(self.physicser.position, 'A') + EnemyDeathEvent.post(self.physicser.position, self.enemy_type) class DeadEnemy(GameObject): @@ -160,9 +163,6 @@ def collide_with_protagonist(self, protagonist): protagonist.lose_health(15) - def hit(self, weapon): - self.lose_health(weapon.damage) - @classmethod def requires(cls): return [("name", "string"), ("position", "coordinates"),