Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex <alex@Tiresias.(none)>2008-07-07 20:53:43 (GMT)
committer Alex <alex@Tiresias.(none)>2008-07-07 20:53:43 (GMT)
commitf6bed1bd417c72145e65cd2acb45c865dfe1add1 (patch)
tree855e6c8416c58bcff24bb4a8bb4b2ce73fcd276b
parentf6e388f082c6c110e4f1eea014858aac3d5e6e4d (diff)
Modified joint tool to use left click to add a centered fixed joint
-rw-r--r--activity.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/activity.py b/activity.py
index 601e409..3714de8 100644
--- a/activity.py
+++ b/activity.py
@@ -258,6 +258,11 @@ class JointTool(Tool):
world.add.joint(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 fixed joint
+ self.jb2 = world.get_bodies_at_pos(event.pos)
+ if self.jb2:
+ world.add.joint(self.jb2[0])
def draw(self):
if self.jb1:
pygame.draw.line(screen,(100,180,255),self.jb1pos,pygame.mouse.get_pos(),3)