Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools.py
diff options
context:
space:
mode:
authorAlex Levenson <alexlevenson@laptop.org>2008-07-10 19:01:23 (GMT)
committer Alex Levenson <alexlevenson@laptop.org>2008-07-10 19:01:23 (GMT)
commit191893b5f035acc0f9d5dfb20c2819065a75c42c (patch)
tree1e90e04ee694b79a98147a79f20095b1092022c8 /tools.py
parentc1bc3f87a1c12b484a17840e180babf026d121cd (diff)
Adding more types of joints...
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools.py b/tools.py
index be0b3b7..0c13581 100644
--- a/tools.py
+++ b/tools.py
@@ -267,17 +267,19 @@ class JointTool(Tool):
self.jb2 = self.game.world.get_bodies_at_pos(event.pos)
# if we have two distinct bodies, add a joint!
if self.jb1 and self.jb2 and str(self.jb1) != str(self.jb2):
- self.game.world.add.joint(self.jb1[0],self.jb2[0],self.jb1pos,self.jb2pos)
+ self.game.world.add.distanceJoint(self.jb1[0],self.jb2[0],self.jb1pos,self.jb2pos)
# If there's only one body, add a fixed joint
elif self.jb2:
- self.game.world.add.joint(self.jb2[0],self.jb2pos)
+ self.game.world.add.fixedJoint(self.jb2[0],self.jb2pos)
# regardless, clean everything up
self.jb1 = self.jb2 = self.jb1pos = self.jb2pos = None
if event.button == 3:
- # add a centered fisxed joint
+ # add a centered fixed joint
self.jb2 = self.game.world.get_bodies_at_pos(event.pos)
if self.jb2:
- self.game.world.add.joint(self.jb2[0])
+ self.game.world.add.fixedJoint(self.jb2[0])
+ # regardless, clean everything up
+ self.jb1 = self.jb2 = self.jb1pos = self.jb2pos = None
def draw(self):
if self.jb1:
pygame.draw.line(self.game.screen,(100,180,255),self.jb1pos,pygame.mouse.get_pos(),3)