0

so i wanted to make a game...and pygame doesn't seem to be working for me. I get this error, "

AttributeError: module 'pygame' has no attribute 'init'"

and ive tried every other forum and cant find help...my game is called roll and I'm using the correct pygame. What do i do?

import pygame
pygame.init()

gamedisplay = pygame.display.set_mode((800,600))
pygame.display.set_caption('roll.io')
clock = pygame.time.Clock()

dead = False

while not dead:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            dead = True

        print(event)

    pygame.display.updat()
    clock.tick(30)

pygame.quit()
quit()
Anthony E
  • 11,072
  • 2
  • 24
  • 44
anonx321
  • 1
  • 1

2 Answers2

0

I've also had some trouble installing pygame for the latest python version, mostly because all guides are either old or don't support the latest python version. So this is what worked for me:

First download(I uploaded it for you because I can't even find the place I originally downloaded it from...) it from here then copy the file and paste it into [your python folder]/scripts, then open cmd type cd [location of your script folder] and finally type pip3 install pygame-1.9.2a0-cp35-none-win32.whl and don't try to rename it to a shorter file name because for some reason it won't work.

0

Have you tried including

    from pygame.locals import *
RoadRunner
  • 25,803
  • 6
  • 42
  • 75