Skip to content

Commit

Permalink
Score display on game end; fixed clock on game reset
Browse files Browse the repository at this point in the history
  • Loading branch information
1024Adam committed Mar 4, 2017
1 parent 372e93d commit e12f5b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions infinite_maze/Clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def getTimeString(self):
return ('{:02d}'.format(self.minutes) + ':' + '{:02d}'.format(self.seconds))

def reset(self):
self.time = pygame.time.Clock()
self.startTime = self.time.get_time()

self.milliseconds = 0
self.seconds = 0
self.minutes = 0
Expand Down
2 changes: 2 additions & 0 deletions infinite_maze/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ def printEndDisplay(self):
# Paint Screen
self.screen.fill(self.bgColor)
endText = self.font.render('Continue? (y/n)', 1, self.fgColor)
scoreText = self.font.render('Score: ' + str(self.score), 1, self.fgColor)

# Print Display Text
self.screen.blit(endText, (10, 10))
self.screen.blit(scoreText, (10, 25))

pygame.display.flip()

Expand Down

0 comments on commit e12f5b2

Please sign in to comment.