Mercurial > fife-parpg
diff demos/shooter/scripts/ships/player.py @ 457:597b066d5ccb
Player now has 3 lives and will receive a game over message once they are used up.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 08 Apr 2010 21:18:36 +0000 |
parents | e686b82d93d0 |
children | 302a69c5141d |
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/player.py Wed Apr 07 21:26:26 2010 +0000 +++ b/demos/shooter/scripts/ships/player.py Thu Apr 08 21:18:36 2010 +0000 @@ -39,6 +39,9 @@ self._lives = 3 + def init(self): + self._lives = 3 + def _getScore(self): return self._score @@ -47,9 +50,13 @@ def destroy(self): self._lives -= 1 - print "player has been destroyed!" + + if self._lives < 0: + self._lives = -1 + def update(self): + key = False oldpos = self.location