In my game there are 9 items that can be bought by coins. These coins can be purchased from store through real currency. I want to make my game progressive i.e. for each of 9 elements there be 9 different values of incremental coins required. Let me clear that out. Let us take example of two of these items as no of lives and health. the first purchase for each one of them is 100 and 150 respectively. After first purchase the next purchase would become 200 and 300 respectively. Don't want to keep 9 stativ variables for each one of them. Any easier way out?
This can be done with a simple calculation, with for example base_price = 150
and level = 0...8
:
int coins = base_price * Math.pow(2, level);
Produces a list of coins like:
0 150
1 300
2 600
3 1200
4 2400
5 4800
6 9600
7 19200
8 38400