So, i have this code:
import pygame
pygame.init()
surface = pygame.display.set_mode((400,1000))
surface.fill((0,0,0))
color = (255,0,255)
pygame.draw.rect(surface, color, pygame.Rect(100, 100, 50, 50))
pygame.draw.rect(surface, color, pygame.Rect(200, 200, 50, 50))
pygame.draw.rect(surface, color, pygame.Rect(100, 200, 50, 50))
pygame.draw.rect(surface, color, pygame.Rect(200, 100, 50, 50))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.display.update()
And i was wondering how to change the rectangle's colors live (like in real time i guess), i have tried using the time module but im new to it so i don't understand it all that well.