# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1270762006 0 # Node ID e77ebf128a74317def685adaecfb86335e862611 # Parent 597b066d5ccb840bd4b7555a53a2e4a6d179f671 Fixed a small bug where projectiles are not updated when it is game over. diff -r 597b066d5ccb -r e77ebf128a74 demos/shooter/scripts/scene.py --- a/demos/shooter/scripts/scene.py Thu Apr 08 21:18:36 2010 +0000 +++ b/demos/shooter/scripts/scene.py Thu Apr 08 21:26:46 2010 +0000 @@ -116,6 +116,7 @@ if self._player.lives <= -1: self._gameover = True self._world.gameOver() + self.removeAllProjectiles() return #TODO: Have to find a better way to do this. If the player @@ -129,15 +130,16 @@ self._player.location = oldpos self._camera.setLocation(self._player.location) + self.removeAllProjectiles() + + def removeAllProjectiles(self): projtodelete = list() for p in self._projectiles: p.destroy() projtodelete.append(p) for p in projtodelete: - self._projectiles.remove(p) - - print len(self._projectiles) + self._projectiles.remove(p) def gameOver(self): self._world.gameOver()