faster and more colors

This commit is contained in:
Nicholas Dyer 2023-02-19 11:56:28 -05:00
parent 1c7a70ecdc
commit ec82eb03ed
No known key found for this signature in database
GPG Key ID: E4E6388793FA2105

View File

@ -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.
pygame.display.flip()
for i in range(5):
window.fill((255, 0, 0))
pygame.display.flip()
time.sleep(0.5)
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.5)
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.5)
window.fill((255, 255, 255))
time.sleep(0.25)
window.fill((255, 0, 255))
pygame.display.flip()
time.sleep(0.5)
window.fill((0, 0, 0))
pygame.display.flip()
time.sleep(0.5)
time.sleep(0.25)
pygame.quit()
game()