Help!
I have some code:for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if (event.type == KEYDOWN):
if self.y == 250:
self.y = 350
else:
self.y = 250
But when I run it says "NameError: global name 'KEYDOWN' is not defined".
I have used the same code in other games but it is not working here.
Can anyone help me with this?
(log in to comment)
Comments
You could have also used pygame.KEYDOWN, like how you used pygame.QUIT.
Cody on
2012/05/06 22:59:
Just realised i forgot to do ''from pygame.locals import *" at the begining