I want to implement a keyboard toggle, press Space to pause animation, press Space again to continue. Reading the keyboard with keydown(), it's often the case the Space is down for longer than one iteration of the game loop, causing a pause and unpause when pressed and released. I've added a dealy (wait 150 ms after pressing key) along with flushing the keyboard, but it's far from ideal.
Any ideas on a nicer way to do this?
EDIT : I could always try KeyHit() instead! Doh!
Any ideas on a nicer way to do this?
EDIT : I could always try KeyHit() instead! Doh!