Make an idle clicker game with upgrades and offline progress
An idle game is a spreadsheet that's fun to watch: you click, you buy something that earns for you, and the numbers keep climbing while you're away. Getting the climb to feel good for hours is a balancing job. Anticode can build one with upgrade curves, offline progress and saves in the player's browser, and you tune the numbers by asking in plain words.
The loop in four parts
- Earn by hand. Clicking or tapping gives a small amount. It's the first minute of the game and should feel tactile: a pop, a number floating up, a sound.
- Buy generators. Things that earn per second without clicking: a lemonade stand, a farm, a factory. Each tier earns much more and costs much more than the one before.
- Multiply. Upgrades that double a generator's output, or boost clicks. These create the moments where income jumps.
- Prestige. Reset progress in exchange for a permanent bonus, so the next run goes faster. It turns a game that would stall into one with a long tail.
Balancing the numbers
The standard approach, used by many incremental games, is exponential cost growth: each copy of a generator costs a fixed percentage more than the last, commonly around 7 to 15 per cent. Income from a generator grows linearly with how many you own, so each purchase is slightly less good value than the one before, which is what makes the next tier tempting. Multiplier upgrades break that slowdown at chosen points.
The feel you're aiming for is a new purchase every few seconds at the start, every minute or so after half an hour, and a natural pause that the next tier or a prestige solves. Write your intent rather than exact formulas: "the first prestige should be reachable in about 40 minutes of active play". Then play it and ask for changes: "tier 3 is too cheap, it makes tier 2 pointless". Keeping all the numbers in one table at the top of the code makes this easy for the model to adjust.
| Symptom | Likely cause | Fix to ask for |
|---|---|---|
| One generator is always the best buy | Its cost grows too slowly | Raise its cost growth, or lower its output |
| Long dead stretch with nothing to buy | A gap between tiers | Add a multiplier upgrade in the gap |
| Prestige never feels worth it | Bonus too small | Base the bonus on a root of lifetime earnings so it scales |
| Numbers get too big too fast | Multipliers stack too freely | Make some multipliers additive, not multiplied together |
Big numbers
Idle games pass a trillion quickly. Ordinary JavaScript numbers hold values up to about 1.8 × 10³⁰⁸, which is enough for most games if you plan for it. They keep only about 15 significant digits, but nobody reads the last digits of a trillion anyway. Display is the bigger question. Pick a format and ask for it: short names (1.5M, 2.3B, 4.1T, then aa, ab), scientific notation (4.1e12), or a setting that lets players choose.
Offline progress and saving
Anticode apps save to the player's browser with local storage, so the game can record the time when the player left. When they return, it works out the seconds that passed and grants the earnings, usually capped (say at eight hours) and often at a reduced rate, then shows a "While you were away" summary. The game isn't running in the background; it simply catches up on return. Also ask for:
- Autosave every few seconds and when the tab is hidden.
- Export and import of the save as text, so players can back up or move devices by hand.
- A save version number, so a later update to the game can convert old saves instead of breaking them.
- Hard reset behind a confirmation built into the page.
Making one with Anticode
Describe the theme, the tiers and the pacing: "An idle game about running a bakery: tap to bake bread, buy ovens, bakers, shops and a factory. Each tier unlocks the next. Upgrades double output. Prestige: sell the business for 'reputation' that boosts everything. Offline earnings up to 6 hours at half rate. Warm colours, big tappable bread." Used as an idle game maker this way, Anticode's model writes it as one HTML document, with art drawn in code and sound from the browser's audio API. It works on phones as well as desktops.
Limits
- No cloud saves. Progress lives in one browser; clearing it loses the save unless the player exported it.
- No leaderboards or trading between players.
- No ads or in-app purchases. The sandbox blocks outside scripts and payments.
- No notifications telling players their factory is full; nothing runs when the page is closed.
For a faster arcade feel, see the endless runner; the browser game maker page covers other genres, and game prototypes covers testing a bigger idea first.
Questions people ask
Can I add more tiers after people have started playing?
Yes, ask for them in a sentence. Keep the save format compatible, or ask for a converter, so existing players keep their progress.
Can players cheat?
Yes, by editing their own save. In a single-player game with no rankings that only affects them.
Will it drain a phone battery?
Pause animations when the tab isn't visible and it uses little power. Ask for that explicitly.