I am trying to code a clicker game and already have a screen, a button to increase money and a upgrade to increase the money made with clicks. The whole thing is made in Tkinter.The next function i am now wanting to code is the passive income function for upgrades, which gives x money for every y seconds
def passive_income(moneygive,seconds): global money if True: money += moneygive time.sleep(seconds)
The problem with this is that it stops/delays the mainloop of the game while the time.sleep function, which is why i tried threading it
thread = threading.Thread(passive_income(10,10))thread.start()#before mainloop
However this doesnt change anything and the thread also doesnt repeat. When i change the if statement to a while loop, the mainloop wont start.How can i code it so that, it doesnt break the mainloop?Thanks in advance