Changeset 210:9a6c711e2fdf


Ignore:
Timestamp:
04/06/11 21:48:09 (12 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Message:

KILLhg statushg status

Location:
skaapsteker/sprites
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/base.py

    r209 r210  
    5252        print "%s collided with player" % self
    5353        player.damage(1)
     54
     55    def damage(self, damage):
     56        print 'Damaged by ', damage
     57        self.health -= damage
     58        print 'Monster health', self.health
     59        if self.health < 0:
     60            self.kill()
    5461
    5562
  • skaapsteker/sprites/player.py

    r209 r210  
    138138
    139139    def collided(self, other):
     140        if self.attacking and hasattr(other, 'damage'):
     141            # FIXME: Check if we're facing the right way
     142            other.damage(5)
    140143        if other not in self._last_collide:
    141144            self._last_collide.append(other)
Note: See TracChangeset for help on using the changeset viewer.