shpapps

Lab · Prototype

Merge Clock

A tiny idle merge game with its economy turned inside out. Merge shapes up the tiers, buy upgrades, and watch the numbers that decide how it feels: income, the wait for the next upgrade, and the curve of costs against income. Then step away for hours in one click and read exactly how the offline earnings were worked out.

  • Merge by drag or keyboard
  • Live pacing panel
  • Cost vs income curve
  • Offline progress, closed form
  • JavaScript and Dart

The game

0 +0 /s

Drag a shape onto its twin to merge them into the next tier, or onto an empty cell to move it. Keyboard: arrow keys move around the board, Enter picks a shape up and Enter again drops or merges it, Escape puts it back.

Pacing, live

Income
–
Next generator
–
Next Polish
–
Highest tier
–

Offline progress

The game saves a timestamp as you play. Come back later, or use the button, and it works out what you earned in one step from the time away: no ticking through the missed seconds.

Copy the code: cost curve and offline earnings

Plain functions with no dependencies, filled in with your growth factors, cap and efficiency. They are the same maths this page runs; the Dart version passes dart analyze and gives the same numbers.

What the toy shows

The wait is the gap between two curves

An upgrade costing c·gn bought with an income of i·rn takes (c/i)·(g/r)n seconds to save for. On a log chart both are straight lines and the wait is the space between them: when g beats r every level waits longer than the last, when they match it stays flat, and when r wins the game runs away from you.

Merging has to pay

Two pieces become one, so a merged piece needs to earn more than two of the old ones for merging to be worth more than the space it frees. At a merge value of 2 it is exactly even; above 2 every merge is a raise. Slide it down to 2 and watch the income stop caring about tiers.

Offline is a formula, not a replay

Save when the player left, and on return compute the earnings in one step: income × time, plus each piece the generator would have spawned earning from its own spawn time, a sum with a closed form. No loop over missed seconds, so twelve hours costs the same as twelve seconds, and the same inputs always give the same answer.

Cap and efficiency are design choices

The cap says how long the game keeps working without the player; the efficiency says how much playing beats being away. A device clock can be changed, so a time away below zero counts as zero, and anything that matters for fairness or money belongs on a server's clock, not the phone's.

While you were away

0