diff demos/shooter/scripts/scene.py @ 460:5e1d6e40d19d

Fixed bounding boxes. Added bounding box renderer. The player is now better confined to the screen. Added more enemies to the map.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 09 Apr 2010 21:42:28 +0000
parents 302a69c5141d
children f87f686b5b59
line wrap: on
line diff
--- a/demos/shooter/scripts/scene.py	Fri Apr 09 17:35:52 2010 +0000
+++ b/demos/shooter/scripts/scene.py	Fri Apr 09 21:42:28 2010 +0000
@@ -74,8 +74,6 @@
 			self._nodes.append(SceneNode())
 
 		self._player = Player(self, 'player')
-		self._player.width = 0.075
-		self._player.height = 0.075
 		self._player.init()
 		self._player.start()
 
@@ -137,7 +135,7 @@
 		if self._player.lives <= -1:
 			self._gameover = True
 			self._world.gameOver()
-			self.removeAllProjectiles()
+			#self.removeAllProjectiles()
 			return
 
 		self._player.setInvulnerable(2)
@@ -240,6 +238,9 @@
 					#re-initialize scene
 					if not self._player.invulnerable:
 						self.playerHit()
+						obj.destroy()
+						
+#			self._world.renderBoundingBox(obj)
 					
 		
 		
@@ -258,12 +259,14 @@
 							o.destroy()
 							#TODO:  the destroy functions should spawn an explosion
 							#and also destroy the instance and remove itself from the scene
-							self.removeObjectFromScene(o)
+							#self.removeObjectFromScene(o)
 						else:
 							#player got hit by a projectile
 							if not self._player.invulnerable:
 								p.destroy()
 								self.playerHit()
+			
+#			self._world.renderBoundingBox(p)
 							
 			
 			#build a list of projectiles to remove (ttl expired)