Math has never been my strong suit and so I'm having trouble figuring out how to write this formula.
When you buy something in my game, the amount it costs to purchase that item will be taken off from your total coin amount one by one. It's a loop that repeats itself till the amount that needs to be taken off is 0. I have that system set in place, but I need to figure out a way to calculate the speed of decrease, or the time between each coin, making sure that each purchase will last the same amount of time, regardless of how much it costs.
What I figured out is that I need to come up with a formula in which the time it takes between each coins should become smaller/shorter the more coins it costs.
e.g. 10 coins taken from your total coin amount should take as long 200 coins. 10 coins -> 0.1 seconds between coins -> 1 second total 200 coins -> 0.005 seconds between coins -> 1 second total 500 coins -> 0.002 seconds between coins -> 1 second total And etc.
It would be greatly appreciated if anyone could push me in the right direction and/or give a little explanation to whether this is possible or not.