From ec82eb03edee626394030bdb4f6becc5773c973b Mon Sep 17 00:00:00 2001 From: nickedyer Date: Sun, 19 Feb 2023 11:56:28 -0500 Subject: [PATCH] faster and more colors --- colors/main.py | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/colors/main.py b/colors/main.py index 8eda80d..4bf6c3c 100644 --- a/colors/main.py +++ b/colors/main.py @@ -14,40 +14,34 @@ def game(): # The game is normally rendered at 80 pixels and upscaled from there. If changing displays, change the # screen_size to reflect what the resolution of the new display is. - screen_size = 700 + screen_size = 720 window = pygame.display.set_mode((screen_size, screen_size)) surface = pygame.Surface((screen_size, screen_size)) clock = pygame.time.Clock() - def draw(): - """ - Draws the main pygame display. - """ - - # Draws all the sprites on screen and scales the screen to the correct size from the rendered size. - frame = pygame.transform.scale(surface, (screen_size, screen_size)) - window.blit(frame, frame.get_rect()) - - # Update the entire display. + for i in range(5): + window.fill((255, 0, 0)) pygame.display.flip() + time.sleep(0.25) + window.fill((255, 255, 0)) + pygame.display.flip() + time.sleep(0.25) + window.fill((0, 255, 0)) + pygame.display.flip() + time.sleep(0.25) + window.fill((0, 255, 255)) + pygame.display.flip() + time.sleep(0.25) + window.fill((0, 0, 255)) + pygame.display.flip() + time.sleep(0.25) + window.fill((255, 0, 255)) + pygame.display.flip() + time.sleep(0.25) + - window.fill((255, 0, 0)) - pygame.display.flip() - time.sleep(0.5) - window.fill((0, 255, 0)) - pygame.display.flip() - time.sleep(0.5) - window.fill((0, 0, 255)) - pygame.display.flip() - time.sleep(0.5) - window.fill((255, 255, 255)) - pygame.display.flip() - time.sleep(0.5) - window.fill((0, 0, 0)) - pygame.display.flip() - time.sleep(0.5) pygame.quit() game()