Python Forum

Full Version: Simple game help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to make a simple game in python.
import pygame
from pygame.locals import *

pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode ((width, height))

player = pygame.image.load("/home/pi/Downloads/resources/images/dude.png")
grass = pygame.image.load("/home/pi/Downloads/resources/images/grass.png")
castle = pygame.image.load("/home/pi/Downloads/resources/images/castle.png")

while 1:
    screen.fill(0)
    
    screen.blit(player, (100,100))
    pygame.display.flip()

    for events in pygame.even.get():
        if events.type==pygame.QUIT:
            pygame.quit()
            exit(0)
I keep getting "AttributeError: module 'pygame' has no attribute 'even'

Would love some help, as I am very new to coding and new to python. Thanks!

just realized i mispelled event as even, so hopefully no one else runs into this problem. Smile
I suspect you are trying to call pygame.event.get() and have misspelled "event".