I am working on a game. I have imported pygame. I am using Python 3.3 and Pygame 3.3. The same error message all the time "LEFT" is not defined. I made exact copies of what was on the Internet as I was already looking for a problem. Here is my code. I tried several different ways and none of them work.
method 1:
import pygame event = pygame.event.poll() if event.type == pygame.MOUSEBUTTONDOWN and event.button == LEFT: ....command
method 2: (basically everything goes)
from pygame import * from pygame.locals import * import pygame event = pygame.event.poll() if event.type == MOUSEBUTTONDOWN and event.button == LEFT: ......command
Before telling me about all these methods, I tried to switch between "LEFT" and "pygame.LEFT", etc.
Any ideas?
Very grateful.
source share