diff demos/shooter/scripts/weapons.py @ 467:4d0aa75a82f1

Added damage so some enemies take more than one hit to destroy. Added the boss at the end of the level. For some reason the high score dialog box that appears after the level is completed causes a crash. Still looking into this one.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 14 Apr 2010 16:22:36 +0000
parents bd7e8f708adf
children 3b04e921c93d
line wrap: on
line diff
--- a/demos/shooter/scripts/weapons.py	Tue Apr 13 21:30:51 2010 +0000
+++ b/demos/shooter/scripts/weapons.py	Wed Apr 14 16:22:36 2010 +0000
@@ -39,6 +39,8 @@
 		
 		self.width = 0.025
 		self.height = 0.025
+		
+		self._damage = 1
 	
 	def create(self, location):
 		self._instance = self._layer.createInstance(self._obj, location.getExactLayerCoordinates(), "bullet")
@@ -72,9 +74,16 @@
 			super(Projectile, self).update()
 		else:
 			self.destroy()
+			
+	def _getDamage(self):
+		return self._damage
+		
+	def _setDamage(self, dam):
+		self._damage = dam
 		
 	ttl = property(_getTTL)
 	owner = property(_getOwner)
+	damage = property(_getDamage, _setDamage)
 	
 class Weapon(object):
 	def __init__(self, scene, ship, firerate):