Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am currently creating a game. In this game, you can upgrade buildings to another level by using resources (such as iron, platinum, etc).

Anyway, I am stuck trying to create a formula for the price based on the level of the building.

I have access to theses variables:

  • Default price for the level 1 (ex: 175)
  • The level of the building

I want to create a formula who's always like that:

  • Level 2 = 175*2 = 350
  • Level 3 = 350*2 = 700
  • Level 4 = 700*2 = 1400
  • etc..

Is that possible ? If so, how ?

No worries about how complicated it can be... If it work, it work.

Thanks for any help - been stuck for hours.

share|improve this question

2 Answers 2

up vote 7 down vote accepted

$$\text{Price of level $n$ = (Default price for level $1$)$ \times 2^{n-1}$.}$$ Hence, if default price for level $1$ is say $175$, then $$\text{Price of level $n = 175 \times 2^{n-1}$.}$$

share|improve this answer

Price of level $n$=$175(2^{n-1})$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.