In my pygame game, there is a time system. Every 5 irl min is one hour in game. I have my code for the time in a while loop that doesn't end. However whenever I run the function it is in, pygame just freezes and stops working completely. Here's the code
gameExit = False
while not gameExit:
sys.stdout.flush()
time.sleep(300)
sys.stdout.flush()
game_time = game_time + 100
if game_time == 2400:
day = day + 1
game_time = 0000
I think the problem is because the while loop never ends and Pygame doesn't seem to like that too much, so how would I make it where the time updates every 5 min but my game won't freeze
Thanks in advance, Shade