An idle game
Numbers going up. Deceptively deep, genuinely fun to build.
Build time ~4 hrs
Idle games are almost pure systems design. There's barely any input — the entire experience is the shape of the numbers, which makes them a superb project for thinking about pacing and balance.
1. The core loop
A resource. A way to gain it manually. Things you buy with it that gain it automatically. Prices that rise so each purchase takes longer. That's it, and it's enough for hours of play if the curve is right.
Build an idle game core. One HTML file. - One resource, gained by clicking. - Three generators, each producing per second, each with a cost that grows exponentially with how many you own. - A tick loop updating on a timer, with display updating separately. - Save to localStorage, and calculate offline progress on load from the elapsed time. Put the balance numbers — base costs, growth rates, production — in one CONFIG object. Explain what each does to the pacing.
2. Offline progress is the feature
The thing that brings people back is opening it and finding the number grew while they were gone. Calculate it from the timestamp difference on load, cap it at some maximum, and show the player exactly what they earned while away.
Guard the clock: players will change their system time. Cap gains, and treat a negative elapsed time as zero rather than as an enormous payout.
3. Number formatting is a real feature
Numbers get large fast. 1234567 is unreadable; 1.23M is not. Beyond that you need suffixes, and beyond that you'll exceed what a standard number type can hold, at which point you need to store numbers as a mantissa and exponent pair.
Decide early how far your game goes. Retrofitting big-number handling is genuinely painful.
4. Balance by playing
There's no formula. Play it, note where you got bored waiting, and adjust. The rule of thumb: each purchase should feel reachable within about a minute early on, stretching gradually. When waiting stops being pleasant, you need a new mechanic — a prestige reset, an upgrade tier, something that changes the shape.
Prestige — resetting for a permanent multiplier — is what turns an idle game from a two-hour toy into something people return to. Design it in from the start, even if you build it last.