[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Keyboard input, too fast!



Hello,
this is my first post on one of these mailing things, so please go nuts at me if I'm doing it all wrong.
Well I need some help, it may be really basic but i haven't been able to find it anywhere.

Problem:
I'm creating a menu for a Pacman game, there are 3 options (New Game, Options, and Exit) I have the code working so that if the user presses down or up it cycles through the options and highlights the selected.
What goes wrong is that when the user presses a key once it tends to repeat it lots. umm how do i explain this. Ok in the main loop
while 1:
#check for user quitting etc.

#now get the user input
keystate = pygame.key.get_pressed()

if keystate[K_DOWN]:
print "hello"

effectively what i get is hello appearing six times. or with my actual code the user can't get to Options because when they press down it zooms past it straight to Exit.

The thing that i dont under stand is i press down once and it says i pressed it six times???


Do i need to attach a code file, does that help?

Well any time and help you can give me is appreciated
:Ant

_________________________________________________________________
Download MSN Messenger @ http://messenger.xtramsn.co.nz - talk to family and friends overseas!