diff options
author | asaf <asafpm@gmail.com> | 2009-07-24 19:29:09 (GMT) |
---|---|---|
committer | asaf <asafpm@gmail.com> | 2009-07-24 19:29:09 (GMT) |
commit | 57c6e13b958b5acb91f22d3e35b9e642380e2c9d (patch) | |
tree | df7573846e4327e83d87e9a00976fe8ae3b5ac4e | |
parent | 039e305cf52c2504c38c3f9af697e1d4f7acea64 (diff) |
Added pin to background functionality
-rw-r--r-- | tools.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -318,7 +318,10 @@ class JointTool(Tool): self.jb2 = self.game.world.get_bodies_at_pos(event.pos) # if we have two distinct bodies, add a distance 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.joint(self.jb1[0],self.jb2[0],self.jb1pos,self.jb2pos) + elif self.jb1: + groundBody = self.game.world.world.GetGroundBody() + self.game.world.add.joint(self.jb1[0],groundBody,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) |