I tried implementing pause in the game, but it does not work consistently. I have to try 10-15 times to actually pause a game.
I suppose the problem is connected with Pygame Key.set_repeat
pygame.key.set_repeat(5,5)
that I coded to be able to move paddle by holding arrow keys without pressing them continuosly.
The code for pausing game is:
elif event.type ==KEYDOWN and event.key == K_SPACE:
if mygame.pause == 0:
mygame.pause =1
else:
mygame.pause = 0
Thanks
Z.