Помогите решить проблему. Вот код ошибки: Traceback (most recent call last):
File "D:\Python\Pigs, escape from the farm\test.py", line 21, in
pygame.draw.rect(win, (0,0,255), (x, y, width, height))
TypeError: argument 1 must be pygame.Surface, not None
import pygame
pygame.init()
win = pygame.display.set_mode((500, 500))
win = pygame.display.set_caption('Cubes Game')
x = 50
y = 50
width = 40
height = 60
speed = 5
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.draw.rect(win, (0,0,255), (x, y, width, height))
pygame.display.update()
pygame.quit()