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.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bridge.py b/bridge.py
index 3857085..a0f3c1c 100644
--- a/bridge.py
+++ b/bridge.py
@@ -11,6 +11,7 @@ class Bridge:
self.capacity = 1
self.first_train = None
self.train_off_screen = False
+ self.train_was_created = False
def create_world(self):
self.world.set_color((100,150,50))
@@ -60,7 +61,10 @@ class Bridge:
print "TRAIN FELL OFF!"
self.train_off_screen = True
- def create_train(self, worldpoint = (-100,490), train = (100, 50), wheelrad = 20, cars = 3):
+ def create_train(self, worldpoint = (-100,490), train = (100, 50), wheelrad = 20, cars = 3, force = False):
+ if not force and self.train_was_created:
+ return
+ self.train_was_created = True
points = []
self.train_off_screen = False
for i in range(0,cars):