Using Python 3.11:
import pygame
import random
from pygame.locals import (
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
K_ESCAPE,
KEYDOWN,
QUIT,
)
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill((0, 0, 0))
pygame.draw.rect(screen, (255, 255, 255), (250,250), 75)
pygame.display.flip()
Does anyone know what the issue with my code is? Why it comes up with this error:
Traceback (most recent call last):
File "C:\Users\USERNAME\Documents\Python_Work\PYTHON_Folder_II\My Tests\2d Test.py", line 28, in <module>
pygame.draw.rect(screen, (255, 255, 255), (250,250), 75)
TypeError: rect argument is invalid