🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

In Idle Miner Tycoon how the currency change from 999 a to 1b?

Started by
2 comments, last by Haziq 4 years, 3 months ago

Hey , a little background a idle miner tycoon is a smartphone game in which the player is playing as a boss of the miners meaning the player don't have to do any things the miner will continue to do their work without player interaction to the game. The player just have to make decision such as buying equipment machines for the miners or hiring more miners or making a smart investment these type of task. The every work is automated and your earning a game currency without doing nothing.Now in this game after the player has reach to certain amount of game currency the currency switch to alphabets. For instance if the player has reach to trillion unit of currency it switches to 1A ,2A ---- 100A, and so on when alphabets (in this case "A") reaches to its limit then the currency will switch to 1B,2B---100B and so forth.Now back to my question how the currency system work? As far as I know we can store value in integer but we cannot store unit in it. Therefore the unit will be save on different variable and we have to match both. So I need to find how to the 999A is switching 1B but not 1000A. In others words how the currency system is working?

Advertisement
if (value ≥ 1000000000)
{
   print((value / 1000000000) + “B”);
}
else if (value ≥ 1000000)
{
    print((value / 1000000) + “M”);
}
else if (value ≥ 1000)
{
    print((value / 1000) + “K”);
}
else
{
    print(value);
}

Something like that, unless the game also allows currency to store values larger than a 64-bit integer, in which case it likely also uses a BigInteger class of some form.

Sorry for the late response somehow I miss this answer thank-you for you're response. So anyway I have find my answer in Reddit below is the link:
https://www.reddit.com/r/gamedev/comments/fijrzr/in_idle_miner_tycoon_how_the_currency_change_from/
Cheers ?

This topic is closed to new replies.

Advertisement