Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools.py b/tools.py
index 44d96ef..1b20da9 100644
--- a/tools.py
+++ b/tools.py
@@ -402,11 +402,15 @@ class DestroyTool(Tool):
self.vertices.append(pygame.mouse.get_pos())
if len(self.vertices) > 10:
self.vertices.pop(0)
+
tokill = self.game.world.get_bodies_at_pos(pygame.mouse.get_pos())
- #self.game.world.world.DestroyJoint(
- #jointlist = tokill[0].GetJointList()
- #print jointlist.joint
+
if tokill:
+ jointnode = tokill[0].GetJointList()
+ if jointnode:
+ joint = jointnode.joint
+ self.game.world.world.DestroyJoint(joint)
+ else:
self.game.world.world.DestroyBody(tokill[0])
elif event.type == MOUSEBUTTONUP and event.button == 1:
self.cancel()