pygame.key.get_pressed[K_a], K_a is not defined!?

globalrev skanemupp at yahoo.se
Fri May 2 12:37:07 EDT 2008


On 2 Maj, 18:13, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> globalrev schrieb:
>
> > if pygame.key.get_pressed[K_a]:
> >             print "Muppet"
>
> > K_a is not defined.
>
> > but yes it is. why do i get this error?
>
> No it isn't - otherwise you wouldn't get this error, wouldn't you?
>
> What IS defined is
>
> pygame.K_a
>
> Or if you do
>
> from pygame import K_a
>
> then K_a is defined as well.
>
> Diez

ok thanks
if (key.get_pressed[K_t] and key.get_pressed[K_f]):
     print "Yup!"

said int he tut it confused me.


anyway i changed it and the list or dict from keygetpressed is all
zeros but the K_a always is true whether i push it or not.







More information about the Python-list mailing list