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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge.py b/bridge.py
index f389206..9d9a401 100644
--- a/bridge.py
+++ b/bridge.py
@@ -42,11 +42,16 @@ class Bridge:
for joint in self.joints:
force = joint.GetReactionForce().Length()
self.stress += force
+
if force > 500:
print "destroy joint!"
self.world.world.DestroyJoint(joint)
self.joints.remove(joint)
self.capacity -= 500
+ else:
+ vec = joint.GetAnchor1()
+ coord = int(self.world.meter_to_screen(vec.x)),int(780 - self.world.meter_to_screen(vec.y))
+ pygame.draw.circle(self.screen, (int(force/2),255-int(force/2),0), coord, 4)
def create_train(self, worldpoint = (-100,490), train = (100, 50), wheelrad = 20, cars = 3):
points = []