From 8afb7765a5e84e576d336ef0f5bc7debf419d453 Mon Sep 17 00:00:00 2001 From: Patrick Tschuchnig Date: Wed, 11 Sep 2019 13:36:08 +0200 Subject: [PATCH] changed flipping to be done at the end of the game routine --- gametest_rev1.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gametest_rev1.py b/gametest_rev1.py index bd14594..8eb03c2 100644 --- a/gametest_rev1.py +++ b/gametest_rev1.py @@ -446,7 +446,6 @@ while True: # draw rectangle border around everything pygame.draw.rect(screen,pygame_color_black, (500, 200, (screen_size_x-500*2), (screen_size_y-200*2)), 5) - if game_running == False and game_ending == False: # one shot for changing the led colour if game_just_started == True: @@ -488,7 +487,7 @@ while True: screen.blit(score3_surface, score3_rectangle) # display everything - pygame.display.flip() + #pygame.display.flip() # event handling for if the start button is pushed if GPIO.input(pin_start) == True and pin_start_inhibit == False: #wait for the user to press start button @@ -552,7 +551,7 @@ while True: screen.blit(header_surface, header_rectangle) #header # display everything - pygame.display.flip() + #pygame.display.flip() # if another push of start is detected (i.e. the game is ending!) if GPIO.input(pin_start) == True and pin_start_inhibit == False: @@ -592,7 +591,7 @@ while True: screen.blit(header_surface, header_rectangle) #header # display everything - pygame.display.flip() + #pygame.display.flip() # unneeded timer, replaced by tick based system #time.sleep(5) @@ -620,6 +619,7 @@ while True: # this state is never supposed to be reached pass + pygame.display.flip() pygame.display.update() pygame_clock.tick(pygame_fps)