Simple game help - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Game Development (https://python-forum.io/forum-11.html) +--- Thread: Simple game help (/thread-29528.html) |
Simple game help - jarettday - Sep-07-2020 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. RE: Simple game help - bowlofred - Sep-07-2020 I suspect you are trying to call pygame.event.get() and have misspelled "event".
|