Changeset 310:fa408430a174


Ignore:
Timestamp:
Sep 5, 2013, 10:41:49 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
rebase_source:
e5c75c52a83dd6d21ea3e3cff6d98719a25f4692
Message:

Now *both* types of enemies die

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/enemies.py

    r308 r310  
    5252        return [("name", "string"), ("position", "coordinates")]
    5353
     54    def hit(self, weapon):
     55        self.lose_health(weapon.damage)
     56
    5457    def lose_health(self, amount):
    5558        self.health -= amount
     
    5760            self.physicser.remove_from_space()
    5861            self.remove = True
    59             EnemyDeathEvent.post(self.physicser.position, 'A')
     62            EnemyDeathEvent.post(self.physicser.position, self.enemy_type)
    6063
    6164
     
    160163    def collide_with_protagonist(self, protagonist):
    161164        protagonist.lose_health(15)
    162 
    163     def hit(self, weapon):
    164         self.lose_health(weapon.damage)
    165165
    166166    @classmethod
Note: See TracChangeset for help on using the changeset viewer.