Mercurial > fife-parpg
comparison demos/shooter/scripts/ships/player.py @ 455:e686b82d93d0
Added the ability to pause the game.
Added the main menu.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 07 Apr 2010 19:37:42 +0000 |
parents | bd7e8f708adf |
children | 597b066d5ccb |
comparison
equal
deleted
inserted
replaced
454:bd7e8f708adf | 455:e686b82d93d0 |
---|---|
34 self._score = 0 | 34 self._score = 0 |
35 self._maxvelocity = 1.5 | 35 self._maxvelocity = 1.5 |
36 | 36 |
37 #give player the default weapon (the cannon) | 37 #give player the default weapon (the cannon) |
38 self.weapon = Cannon(self._scene, self, 200) | 38 self.weapon = Cannon(self._scene, self, 200) |
39 | |
40 self._lives = 3 | |
39 | 41 |
40 def _getScore(self): | 42 def _getScore(self): |
41 return self._score | 43 return self._score |
42 | 44 |
43 def applyScore(self, sc): | 45 def applyScore(self, sc): |
44 self._score += sc | 46 self._score += sc |
45 | 47 |
46 def destroy(self): | 48 def destroy(self): |
49 self._lives -= 1 | |
47 print "player has been destroyed!" | 50 print "player has been destroyed!" |
48 | 51 |
49 def update(self): | 52 def update(self): |
50 key = False | 53 key = False |
51 | 54 |
102 | 105 |
103 | 106 |
104 | 107 |
105 self.location = oldpos | 108 self.location = oldpos |
106 | 109 |
110 def _getLives(self): | |
111 return self._lives | |
107 | 112 |
108 score = property(_getScore) | 113 score = property(_getScore) |
114 lives = property(_getLives) |