Skip to content

Commit

Permalink
Get rid of the running variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
asweigart committed Aug 10, 2012
1 parent 5cdd7f0 commit bdb64d2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions square-shooter/square-shooter_makeover.py
Expand Up @@ -606,23 +606,22 @@ def render_pause_text(self):
pygame.display.set_caption("Square Shooter Desktop Edition")
pygame.event.set_blocked(pygame.MOUSEMOTION)

running = True
while running:
while True:
delta_t = clock.tick(60)
if DISPLAY_FPS:
renderer.fps = int(round(clock.get_fps()))

ev = pygame.event.poll()
if ev.type == pygame.QUIT:
running = False
break
elif ev.type == pygame.KEYUP:
if ev.key == pygame.K_ESCAPE:
running = False
break
elif ev.key == pygame.K_q:
if world.level > 0:
world.level = 0
else:
running = False
break
elif ev.key == pygame.K_p:
if world.level == 0:
world.score = 0
Expand Down

0 comments on commit bdb64d2

Please sign in to comment.