Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bridge.py
diff options
context:
space:
mode:
Diffstat (limited to 'bridge.py')
-rw-r--r--bridge.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bridge.py b/bridge.py
index 6dac4c7..62a0f76 100644
--- a/bridge.py
+++ b/bridge.py
@@ -5,6 +5,7 @@ class Bridge:
self.game = game
self.screen = game.screen
self.world = game.world
+ self.joints = []
def create_world(self):
rect = pygame.Rect((0,800), (350, -250))
@@ -20,4 +21,13 @@ class Bridge:
def joint_added(self, joint):
print "joint added!"
+ self.joints.append(joint)
+
+ def for_each_frame(self):
+ for joint in self.joints:
+ force = joint.GetReactionForce().Length()
+ if force > 500:
+ print "destroy joint!"
+ self.world.world.DestroyJoint(joint)
+ self.joints.remove(joint)