When i run my pygame code, i get the following error:
>>>
RESTART: C:/Users/lanra/Desktop/2018 backups/2018 python/pygame/pygame 2.py
Traceback (most recent call last):
File "C:/Users/lanra/Desktop/2018 backups/2018 python/pygame/pygame 2.py", line 1, in <module>
import pygame
File "C:/Users/lanra/Desktop/2018 backups/2018 python/pygame\pygame.py", line 3, in <module>
pygame.init()
AttributeError: module 'pygame' has no attribute 'init'
My code:
import pygame
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("first game")
x = 50
y = 50
width = 40
height = 60
vel = 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, (255,0,0))
pygame.quit()