My Pygame window will only update if my cursor is moving and is above the window.
import pygame
window_length = 1000
window_height = 600
dimensions = (window_length, window_height)
window = pygame.display.set_mode(dimensions)
WHITE = (255, 255, 255)
BLACK = (0,0,0)
main = True
x = 0
y = 0
while main:
for event in pygame.event.get():
if event.type == pygame.QUIT:
main = False
x += 1
#redraw background
pygame.draw.rect(window, BLACK, (0,0, window_length, window_height))
pygame.draw.rect(window, WHITE, (x, y, 100, 100))
pygame.display.update()
pygame.quit()
I tried moving things around but nothing worked.