diff 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
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/player.py	Tue Apr 06 21:25:10 2010 +0000
+++ b/demos/shooter/scripts/ships/player.py	Wed Apr 07 19:37:42 2010 +0000
@@ -36,6 +36,8 @@
 		
 		#give player the default weapon (the cannon)
 		self.weapon = Cannon(self._scene, self, 200)
+		
+		self._lives = 3
 	
 	def _getScore(self):
 		return self._score
@@ -44,6 +46,7 @@
 		self._score += sc
 		
 	def destroy(self):
+		self._lives -= 1
 		print "player has been destroyed!"
 	
 	def update(self):
@@ -104,5 +107,8 @@
 
 			self.location = oldpos
 
+	def _getLives(self):
+		return self._lives
 
-	score = property(_getScore)
\ No newline at end of file
+	score = property(_getScore)
+	lives = property(_getLives)
\ No newline at end of file