Advertisement

How do I implement a multiplier to buy multiple levels at once?

Started by November 19, 2021 06:40 PM
0 comments, last by Hondalf 3 years ago

Please help to implement the function of buying multiple levels as in the screenshots.

To calculate the new price use the formula:

newCost = baseCost * Mathf.Pow(multi,lvl);

float baseCost - fixed base price of buying a levelnew

float newCost - constantly changing new price

float multi - multiplier, which is equal to 1.09

int lvl - the degree which is increased by the value of the level

Because of this formula, the price increases with each level, and I can't buy multiple levels at once.

I am new to C#, if you can explain in more detail, I would appreciate it.

This topic is closed to new replies.

Advertisement