Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Get rid of the running variable.

  • Loading branch information...
commit bdb64d21e5dc6535dfcb8e89a20b84b60df72add 1 parent 5cdd7f0
Al Sweigart authored August 10, 2012

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. 9  square-shooter/square-shooter_makeover.py
9  square-shooter/square-shooter_makeover.py
@@ -606,23 +606,22 @@ def render_pause_text(self):
606 606
 pygame.display.set_caption("Square Shooter Desktop Edition")
607 607
 pygame.event.set_blocked(pygame.MOUSEMOTION)
608 608
 
609  
-running = True
610  
-while running:
  609
+while True:
611 610
     delta_t = clock.tick(60)
612 611
     if DISPLAY_FPS:
613 612
         renderer.fps = int(round(clock.get_fps()))
614 613
 
615 614
     ev = pygame.event.poll()
616 615
     if ev.type == pygame.QUIT:
617  
-        running = False
  616
+        break
618 617
     elif ev.type == pygame.KEYUP:
619 618
         if ev.key == pygame.K_ESCAPE:
620  
-            running = False
  619
+            break
621 620
         elif ev.key == pygame.K_q:
622 621
             if world.level > 0:
623 622
                 world.level = 0
624 623
             else:
625  
-                running = False
  624
+                break
626 625
         elif ev.key == pygame.K_p:
627 626
             if world.level == 0:
628 627
                 world.score = 0

0 notes on commit bdb64d2

Please sign in to comment.
Something went wrong with that request. Please try again.