Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bridge.py
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2012-10-24 02:36:28 (GMT)
committer Gary Martin <gary@garycmartin.com>2012-10-24 02:36:28 (GMT)
commitf6bdcd0fcb271f352ac1d67b34eaeea65e0829b8 (patch)
treee631be3ece6ce53165fa924b0fe2dfbed2f37d97 /bridge.py
parent559fc4f0caa122442f78969f2eb65bc4c1c250d9 (diff)
Draw ground so no sky is visible below ground and position rivet stress dots correctly for variable screen height.
Diffstat (limited to 'bridge.py')
-rw-r--r--bridge.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bridge.py b/bridge.py
index 7b66748..82a39b8 100644
--- a/bridge.py
+++ b/bridge.py
@@ -24,12 +24,12 @@ class Bridge:
def create_world(self):
self.world.set_color((100, 150, 50))
- rect = pygame.Rect((-400, 800), (750, -250))
+ rect = pygame.Rect((-400, 825), (750, -250))
rect.normalize()
pygame.draw.rect(self.screen, (100, 180, 255), rect, 3)
self.world.add.rect(rect.center, rect.width / 2, rect.height / 2,
dynamic=False)
- rect = pygame.Rect((1600, 800), (-750, -250))
+ rect = pygame.Rect((1600, 825), (-750, -250))
rect.normalize()
pygame.draw.rect(self.screen, (100, 180, 255), rect, 3)
self.world.add.rect(rect.center, rect.width / 2, rect.height / 2,
@@ -72,9 +72,11 @@ class Bridge:
else:
vec = j.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)
+ int(self.screen.get_height() -
+ self.world.meter_to_screen(vec.y))
+ pygame.draw.circle(self.screen,
+ (int(force / 2), 255 - int(force / 2), 0),
+ coord, 6)
except AttributeError:
pass
pos = self.first_train.GetPosition()