I am trying to make a clicker game basics/prototypes. In this i have to add an upgrade which does auto click, for example when purchased, the upgrade will add 5 coins to the total.
So i put it in a Do Loop, the problem is the coins increase way too fast. I want to be able to put a pause or wait 1 second then add 5 coins to the total_coins_variable.
I was able to slow down the do loop(at least for my purposes, slow down the total_coins_variable) by using a float number and add like 0.0015 to the auto clicker value. This did fix the problem of the fast increment of the total_coins_variable but the problem is there is no accurate way to tell how much time has gone by. So if i write in the game that the total_coins_variable will increase by 5 coins every second, this won't be accurate in this case and manually timing will be a pain and not nearly as accurate.
TL
R i want to be able to make a do loop execute the code in it, once every second.
I'd appreciate any and all help.