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.