Changeset 208:c72d9bf911fb


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

Add start of player damage

Location:
skaapsteker/sprites
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/base.py

    r206 r208  
    4949
    5050
    51     def collided_player(self):
     51    def collided_player(self, player):
    5252        print "%s collided with player" % self
     53        player.damage(1)
    5354
    5455
  • skaapsteker/sprites/player.py

    r206 r208  
    145145            self._collisions_seen += 1
    146146        if hasattr(other, 'collided_player'):
    147             other.collided_player()
     147            other.collided_player(self)
     148            print 'Health', self.the_world.fox.health
     149
     150    def damage(self, damage):
     151        self.the_world.fox.health -= damage
     152        if self.the_world.fox.health < 0:
     153            print 'You should have dided'
    148154
    149155
Note: See TracChangeset for help on using the changeset viewer.