Page 1 of 1

my problem with pygame EVENT !

Posted: Mon Aug 31, 2015 5:24 pm
by Mahan_Micro
Hi
I'm learning python by Mag pi :)
in mag pi 33 , there is a code for keyboard contrrol (keyboard.py)
when i compile it,i see following error :

if event.key == pygame.K_UP:
'module' object has no attribute 'K_UP' :!: :!: :!:

why????? in first I import :
import pygame, sys
import pygame.locals as GAME_GLOBALS
import pygame.event as GAME_EVENTS

what's your idea ?? :?:

Re: my problem with pygame EVENT !

Posted: Mon Aug 31, 2015 5:26 pm
by Mahan_Micro
excuse me , program runs correctly but when I push a key of keyboard this error apear and program stop