I would like to add 1 to the variable every minute without interfering with the code already running.
This is a game, so I want the background for tree + 1, rock + 1, fish + 1 to happen every minute without knowing the user.
time.sleep will not work in this situation because it pauses the entire program.
start=time.time()
end=time.time()
if end-start > 60:
wood = wood+1
rock = rock+1
I tried to do something higher, but could not get him to constantly count. It only determines how long it will take to execute # some code.
Any help would be great! Thanks in advance.
source
share