intermediate

Build an Idle Game

Passive income, upgrades, offline earnings, and prestige — the core loop for idle and incremental games.

5 scripts · 1 system

Learning Path

Follow these steps in order to build your Idle Game.

Included Scripts

Touch & Mobile Intermediate

Idle Income Generator

Passive income system for idle/clicker games with offline earnings calculation, upgrade scaling, ...

MobileGeneral
public double IncomePerSecond => CalculateIncome();
public static string FormatNumber(double number)
{
    if (number >= 1e12) return (number / 1e12).ToString("F1") + "T";
2022.3+ · 4.5 KB
Touch & Mobile Beginner

Score Manager

Complete score management system with high score persistence, combo multipliers with decay, and s...

Hyper CasualMobile
public static ScoreManager Instance { get; private set; }
public void AddScore(int points)
{
    int earnedPoints = points * ComboMultiplier;
2022.3+ · 3.3 KB
Touch & Mobile Intermediate

Mobile Responsive UI Scaler

Dynamically adjusts UI scaling based on device aspect ratio, DPI, and orientation. Works with Uni...

MobileGeneral
[RequireComponent(typeof(CanvasScaler))]
public class MobileResponsiveScaler : MonoBehaviour
{
    [SerializeField] private Vector2 referenceResolution = new Vector2(1080, 1920);
    canvasScaler.matchWidthOrHeight = match;
2022.3+ · 4.0 KB
Touch & Mobile Beginner

Tap Input Handler

Handles single tap, double tap, and long press gestures with configurable timing. Provides tap po...

MobileHyper Casual
public UnityEvent<Vector2> onSingleTap;
public UnityEvent<Vector2> onDoubleTap;
public UnityEvent<Vector2> onLongPress;
2022.3+ · 3.6 KB
Touch & Mobile Beginner

Mobile Safe Area Handler

Automatically adjusts UI RectTransform to respect device safe areas on notched phones and tablets...

MobileGeneral
[RequireComponent(typeof(RectTransform))]
public class MobileSafeArea : MonoBehaviour
{
    Rect safeArea = Screen.safeArea;
    anchorMin.x /= Screen.width;
2022.3+ · 2.8 KB

Related Systems

Idle Game System

intermediate 3 files

Core systems for idle/incremental games — passive income generation, offline earnings, upgrade progression, number formatting, and responsive mobile UI.

Mobile
Passive income generation per second Offline earnings calculation on app resume Exponential cost upgrade system Number formatting (K, M, B, T)