Skip to content

Commit

Permalink
Udpated Game-Over Screen handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MeridianGH committed Sep 24, 2019
1 parent 443055f commit 319d453
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pong.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,12 @@ def pong(genomes, config):
arena.display_text('Gen: ' + str(gen), (50, 25), 'topleft')
arena.display_text('Paddles: ' + str(len(paddles_ai)),
(50, height - linethickness/2 - 25), 'bottomleft')
elif paddle_left.game_over:
arena.game_over_screen(1)
else:
paddle_left.score = 0
break

# Draw Game-Over-Screen.
if paddle_left.game_over:
arena.game_over_screen(1)

# Update the screen and tick the clock once.
pygame.display.update()
fpsclock.tick(fps)
Expand Down

0 comments on commit 319d453

Please sign in to comment.