Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/physics.py
diff options
context:
space:
mode:
Diffstat (limited to 'physics.py')
-rw-r--r--physics.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/physics.py b/physics.py
index 68e5ed0..25164c4 100644
--- a/physics.py
+++ b/physics.py
@@ -72,7 +72,7 @@ class PhysicsGame:
for event in pygame.event.get():
self.currentTool.handleEvents(event)
# Clear Display
- self.screen.fill((80,160,240)) #255 for white
+ self.screen.fill((80, 160, 240)) #255 for white
# Update & Draw World
self.world.update()
@@ -84,21 +84,21 @@ class PhysicsGame:
self.currentTool.draw()
#Print all the text on the screen
- text = self.font.render(_("Total Cost: %d") % self.bridge.cost, True, (0,0,0))
- textpos = text.get_rect(left=100,top=7)
+ text = self.font.render(_("Total Cost: %d") % self.bridge.cost, True, (0, 0, 0))
+ textpos = text.get_rect(left=100, top=7)
self.screen.blit(text,textpos)
- ratio = self.bridge.stress*100/self.bridge.capacity
- text = self.font.render(_("Stress: %d%%") % ratio, True, (0,0,0))
- textpos = text.get_rect(left=100,top=25)
+ ratio = self.bridge.stress * 100 / self.bridge.capacity
+ text = self.font.render(_("Stress: %d%%") % ratio, True, (0, 0, 0))
+ textpos = text.get_rect(left=100, top=25)
self.screen.blit(text,textpos)
if self.bridge.train_off_screen:
- text = self.font.render(_("Train fell off the screen, press R to try again!"), True, (0,0,0))
+ text = self.font.render(_("Train fell off the screen, press R to try again!"), True, (0, 0, 0))
elif self.bridge.level_completed:
- text = self.font.render(_("Level completed, well done!! Press T to send another train."), True, (0,0,0))
+ text = self.font.render(_("Level completed, well done!! Press T to send another train."), True, (0, 0, 0))
else:
- text = self.font.render(_("Press the Spacebar to start/pause."), True, (0,0,0))
- textpos = text.get_rect(left=100,top=43)
+ text = self.font.render(_("Press the Spacebar to start/pause."), True, (0, 0, 0))
+ textpos = text.get_rect(left=100, top=43)
self.screen.blit(text,textpos)
# Flip Display
@@ -117,7 +117,7 @@ def main():
pygame.init()
pygame.display.init()
x,y = pygame.display.list_modes()[0]
- screen = pygame.display.set_mode((x,y-toolbarheight-tabheight))
+ screen = pygame.display.set_mode((x,y - toolbarheight - tabheight))
# create an instance of the game
game = PhysicsGame(screen)
# start the main loop