Hi there I'm trying to detect if the "w" key is pressed and I keep getting an error and can't see where I've went wrong. Grateful for advice.
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.key == pygame.K_w: #line 82
player.walkNorthAnimation()
t.displayTree()
The error is:
Traceback (most recent call last):
File "unnamed.py", line 91, in <module>
main()
File "unnamed.py", line 82, in main
if event.key == pygame.K_w:
AttributeError: event member not defined
eventinsideforloop and post the output here?