Credit Economy

Credits are the soft currency awarded at the end of every arcade run. The total is built from one tier base plus three performance bonuses, then revealed as four animated chunks on the post-run reveal screen.

Formula

total = baseAtTier(tier) × (1 + killBonus + eventBonus + levelBonus)

Each bonus is a 0..1 fraction computed as clamp(current / (2 × par), 0, 1). Hitting par exactly contributes 0.5 of the base; hitting 2 × par or more contributes 1.0 (the cap). With every bonus maxed, a run pays out 4 × baseAtTier(tier).

Lives in data/economy.ts as computeArcadeCredits / computeArcadeCreditsBreakdown, called from MissionResult at run end.

Tier base

baseAtTier(tier) = (200 / 3) × 2^(tier - 1). Pure doubling per tier, so the curve ramps fast:

TierBase (rounded)Min payoutMax payout (all bonuses maxed)
16767267
2133133533
32672671,067
45335332,133
51,0671,0674,267
62,1332,1338,533

A clean run at tier T is worth roughly the maxed-bonus run at tier T - 2. The tier ladder matters more than within-tier performance.

The three bonuses

Each bonus has its own par derived from the tier. The bar fill on the reveal screen displays current / par, but the bonus value is current / (2 × par), so the bar reading “100%” only contributes half the cap.

BonusStat trackedPar formulaCap (2× par)
Kill bonuscombat.totalKills500 × tier1,000 × tier
Event bonusprogression.eventsCompleted12 × tier24 × tier
Level bonusprogression.levelReachedparLevel(tier)2 × parLevel(tier)

parLevel: tiers 1/2/3 are 10/15/20, then +4 per tier thereafter (tier 4 = 24, tier 5 = 28, …).

Four chunks, exact sum

computeArcadeCreditsBreakdown returns four integer chunks that always sum to total exactly:

  • tierBase = round(base)
  • killBonusCredits = round(base × killBonus)
  • eventBonusCredits = round(base × eventBonus)
  • levelBonusCredits = total − tierBase − killBonusCredits − eventBonusCredits (clamped to ≥ 0)

The level bonus is the residual that absorbs rounding drift — independent rounding of three multiplications can overshoot the total by up to 2 credits, and we’d rather lose a credit on display than tween the wallet counter backwards. This guarantees the reveal screen’s four-chunk animation lands on the exact wallet total.

Reveal screen tween

The reveal screen consumes the breakdown to animate four bars filling in sequence — tier base, then kills, then events, then level — with the wallet counter tweening from 0 to total across the four reveals. Bar labels read current / par; bar fills use the 0..1 bonus fractions directly. See screens/reveal-screen.

Other credit sources

Arcade runs are the dominant source. Smaller fixed amounts come from:

  • Ad reward slot material_credits — 150 credits per 2 ad views (AD_REWARD_SLOTS in data/economy.ts).
  • Level reward track chests — 10 / 25 / 40 / 60 / 150 credits at the 20%/40%/60%/80%/100% milestones (LEVEL_REWARD_TRACK in data/reward-cards.ts).
  • Legacy rollPostRunRewards ranges in reward-cards.ts (CREDITS_RANGES: bronze 5–15, silver 12–30, gold 25–55, diamond 45–100) — these belong to the older random-roll path and are not used by the current computeArcadeCredits flow.

See also