Idle Game System
Core systems for idle/incremental games — passive income generation, offline earnings, upgrade progression, number formatting, and responsive mobile UI.
3 scripts intermediate Core system Idle/incremental/clicker game developers
Download idle-game-system.zip 3 scripts and a README · 14 KB of C# · MIT
What is inside
- IdleIncomeGenerator.cs Passive income system for idle/clicker games with offline earnings calculation, upgrade scaling, and prestige mechanics. Handles large numbers with K/M/B/T formatting.
- ScoreManager.cs Complete score management system with high score persistence, combo multipliers with decay, and score change events. Uses singleton pattern for easy global access.
- MobileResponsiveScaler.cs Adjusts UI scale to the device's aspect ratio, DPI and orientation alongside CanvasScaler, so fonts stay readable and layouts hold on every phone.
What it does
- Passive income generation per second
- Offline earnings calculation on app resume
- Exponential cost upgrade system
- Number formatting (K, M, B, T)
- Prestige/reset with permanent multipliers
- Responsive UI scaling for all screen sizes
Setup, in order
- Import all scripts into your Unity project
- Add IdleIncomeGenerator to a persistent manager object
- Configure income sources, base rates, and upgrade costs in the inspector
- Attach ScoreManager to track currency and high scores
- Add MobileResponsiveScaler to your root Canvas for adaptive UI layout
If something does not work
- Offline earnings are not paid out
- IdleIncomeGenerator saves the quit time in PlayerPrefs from OnApplicationPause and OnApplicationQuit, and pays the difference on the next start. Stopping Play mode in the Editor may skip the pause event; test offline earnings in a build.
- The UI layout breaks on tablets
- Put MobileResponsiveScaler on the root Canvas that has the CanvasScaler. It adjusts the scaler's width-height match from the screen shape, so anchor UI elements to corners and edges rather than placing them by absolute position.
Preview
An excerpt of the kit's main types, and the Inspector fields they expose.
Inspector
Fields from the kit's preview excerpt; the full kit has more.
Base Income Per Second 1
Upgrade Cost Multiplier 1.15
Excerpt
C#
// IdleIncomeGenerator.cs - Passive income with offline earnings
public class IdleIncomeGenerator : MonoBehaviour
{
[SerializeField] private double baseIncomePerSecond = 1.0;
[SerializeField] private double upgradeCostMultiplier = 1.15;
public double CurrentIncome { get; private set; }
public int UpgradeLevel { get; private set; }
public void PurchaseUpgrade()
{
double cost = GetUpgradeCost();
// Deduct currency, increase income, scale cost
UpgradeLevel++;
CurrentIncome = baseIncomePerSecond * UpgradeLevel;
}
public double CalculateOfflineEarnings()
{
// Calculate earnings since last session
double elapsed = (DateTime.Now - lastSaveTime).TotalSeconds;
return CurrentIncome * elapsed * offlineMultiplier;
}
}Related
- Hyper-Casual Starter KitEverything you need to prototype hyper-casual games in hours — one-tap input, endless runner template, stack mechanic, score tracking, and swipe controls.
- Build an Idle GamePassive income, upgrades, offline earnings, and prestige — the core loop for idle and incremental games.