diff demos/shooter/scripts/ships/player.py @ 450:ba6817013343

Added score keeping ability. Some misc cleanup. Fixed the bounding box. Enemies are now removed from the scene when they are destroyed.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 01 Apr 2010 19:26:56 +0000
parents 1cf56403347a
children f463ab431cc0
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/player.py	Thu Apr 01 18:44:01 2010 +0000
+++ b/demos/shooter/scripts/ships/player.py	Thu Apr 01 19:26:56 2010 +0000
@@ -30,7 +30,14 @@
 	def __init__(self, model, playerName, layer):
 		super(Player, self).__init__(model, playerName, layer)
 		self._bounds = Rect(-100,-100,200,200)
+		self._score = 0
+	
+	def _getScore(self):
+		return self._score
 		
+	def applyScore(self, sc):
+		self._score += sc
+	
 	def update(self, timedelta, keystate, camera):
 		key = False
 		
@@ -97,3 +104,5 @@
 
 			self.location = oldpos
 
+
+	score = property(_getScore)
\ No newline at end of file