0

In order to use any code for when the game window is active I have to use a large while function to do this. (Anyone else who uses pygame hopefully knows what I am talking about).

However, I need to use time.sleep and probably other while functions within the game's code. If I use any sleep functions or while loops it causes the game to slow massively and almost freeze until it is unplayable. And I need to use a time delay for some of the in-game animations and scores...etc.

If anyone could help then I would appreciate it. I haven't included the game's code with this for the simple fact it is about 600 lines long and seems pointless to do a huge code dump.

Anyway, thanks in advance.

  • Also helpful: https://stackoverflow.com/questions/30037506/pygame-help-game-text-constantly-stuck-on-screen-timer-not-working – sloth Mar 11 '16 at 10:18
  • And this: https://stackoverflow.com/questions/18948981/do-something-every-x-milliseconds-in-pygame – sloth Mar 11 '16 at 10:18

0 Answers0