diff demos/shooter/scripts/ships/player.py @ 471:7a79dc2a0592

Adding the credits window (still needs to be written) Hopefully fixed some memory leaks. Moved the flashing code to the appropriate spot (in ShipBase).
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 15 Apr 2010 15:53:06 +0000
parents c4f745a566d6
children 10aff123c62c
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/player.py	Wed Apr 14 19:15:27 2010 +0000
+++ b/demos/shooter/scripts/ships/player.py	Thu Apr 15 15:53:06 2010 +0000
@@ -34,12 +34,8 @@
 	def onInstanceActionFinished(self, instance, action):
 		if action.getId() == 'explode':
 			self._ship.respawn()
-		if action.getId() == 'flash':
-			if self._ship._flashnumber > 0:
-				self._ship.instance.act('flash', self._ship.instance.getFacingLocation())
-				self._ship._flashnumber -= 1	
-			else:	
-				self._ship._flashing = False
+		
+		super(PlayerActionListener, self).onInstanceActionFinished(instance, action)
 		
 		
 class Player(Ship):
@@ -100,6 +96,9 @@
 			self._invulnerable = True
 			self._lives -= 1		
 
+	def fire(self, direction):
+		return self._weapon.fire(direction)
+
 	def update(self):
 	
 		key = False