From 769c6f914e80eff13401611c8c0329e610b7ed45 Mon Sep 17 00:00:00 2001 From: Patrick Tschuchnig Date: Tue, 27 Aug 2019 15:15:40 +0200 Subject: [PATCH] changed the way the game ends --- gametest.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/gametest.py b/gametest.py index 6833974..d53b392 100644 --- a/gametest.py +++ b/gametest.py @@ -165,28 +165,27 @@ while True: # main loop #if GPIO.input(startPin) == False: # justStarted = False #if GPIO.input(startPin) == True and justStarted == False: - if GPIO.input(startPin) == True: - #break - continue #skip the rest + if GPIO.input(startPin) != True: - clearScreen() - header_surface = font.render('Game over!', True, mainFontColor) + clearScreen() + header_surface = font.render('Game over!', True, mainFontColor) - screen.blit(errors_surface, errors_rectangle) #errors - screen.blit(time_surface, time_rectangle) #time - screen.blit(header_surface, header_rectangle) #header + screen.blit(errors_surface, errors_rectangle) #errors + screen.blit(time_surface, time_rectangle) #time + screen.blit(header_surface, header_rectangle) #header - pygame.display.flip() + pygame.display.flip() - #while GPIO.input(startPin) == False: - # handle_events() + #while GPIO.input(startPin) == False: + # handle_events() - #while GPIO.input(startPin) == True: - # handle_events() + #while GPIO.input(startPin) == True: + # handle_events() - #while GPIO.input(startPin) == False: - # handle_events() + #while GPIO.input(startPin) == False: + # handle_events() + + clearScreen() + time.sleep(10) + break - clearScreen() - time.sleep(10) - break