- #1
danielmchugh
- 3
- 0
Okay so i am building an incremental game and have a formula to work out how much it will cost to buy a set amount of buildings.
This is required as each time you buy a building the price for that building goes up.This formula is as follows:
((BaseCost * (1.07^b - 1.07^a)) / 0.07)BaseCost = Starting cost of buildings.
a = number of buildings i already own.
b = number of buildings i will own after buyingThis formula will give me a cost if i give it a set amount i want to buy.
But i need to work out how many i can buy with a finite amount of money, say 20000 if the base cost is 200 each and i already own 50.
This is required as each time you buy a building the price for that building goes up.This formula is as follows:
((BaseCost * (1.07^b - 1.07^a)) / 0.07)BaseCost = Starting cost of buildings.
a = number of buildings i already own.
b = number of buildings i will own after buyingThis formula will give me a cost if i give it a set amount i want to buy.
But i need to work out how many i can buy with a finite amount of money, say 20000 if the base cost is 200 each and i already own 50.