Mercurial > nagslang
changeset 310:fa408430a174
Now *both* types of enemies die
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Fri, 06 Sep 2013 00:41:49 +0200 |
parents | 2b0494b3ce6a |
children | efe28e9d510a |
files | nagslang/enemies.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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"),