changeset 295:b398b0bc3f17

Bullets don't collide with sensors
author Stefano Rivera <stefano@rivera.za.net>
date Thu, 05 Sep 2013 23:31:00 +0200
parents a2120ba50eb6
children eb08426a58fe
files nagslang/game_object.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/nagslang/game_object.py	Thu Sep 05 23:27:45 2013 +0200
+++ b/nagslang/game_object.py	Thu Sep 05 23:31:00 2013 +0200
@@ -352,9 +352,9 @@
         r = self.get_space().segment_query(self.last_position, position)
         self.last_position = position
         for collision in r:
-            if collision.shape.collision_type == self.source_collision_type:
-                continue
-            if collision.shape == self.physicser.get_shape():
+            if (collision.shape.collision_type == self.source_collision_type
+                    or collision.shape == self.physicser.get_shape()
+                    or collision.shape.sensor):
                 continue
             print "Hit", collision.shape.collision_type
             self.physicser.remove_from_space()