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

Re: [pygame] Two questions regarding a simple space shooter



Just curious: if you want to catch any key that was pressed, then this
method could skip some pressed keys or not?
Assuming you press a key an let it go before it comes to the
eventhandling part of the code the it will not appear in
pygame.key.get_pressed(), right? But it stays in the eventqueue.

The polling is happening once per frame, so you could miss a keypress that lasted less than a frame, or be most of a frame late in noticing when a key is pressed. On the other hand, frames are only 10-20ms apart (60fps would be 16.6666...), so it's probably close enough :)