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:
| Tier | Base (rounded) | Min payout | Max payout (all bonuses maxed) |
|---|---|---|---|
| 1 | 67 | 67 | 267 |
| 2 | 133 | 133 | 533 |
| 3 | 267 | 267 | 1,067 |
| 4 | 533 | 533 | 2,133 |
| 5 | 1,067 | 1,067 | 4,267 |
| 6 | 2,133 | 2,133 | 8,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.
| Bonus | Stat tracked | Par formula | Cap (2× par) |
|---|---|---|---|
| Kill bonus | combat.totalKills | 500 × tier | 1,000 × tier |
| Event bonus | progression.eventsCompleted | 12 × tier | 24 × tier |
| Level bonus | progression.levelReached | parLevel(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_SLOTSindata/economy.ts). - Level reward track chests — 10 / 25 / 40 / 60 / 150 credits at the 20%/40%/60%/80%/100% milestones (
LEVEL_REWARD_TRACKindata/reward-cards.ts). - Legacy
rollPostRunRewardsranges inreward-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 currentcomputeArcadeCreditsflow.
See also
data/economy.md— full constants reference (death defiance, gem packs, ad slots, starter inventory)data/reward-cards.md— reward card definitions and level reward trackdata/mission-result.md— input shape consumed bycomputeArcadeCreditsscreens/reveal-screen.md— the four-chunk tween consumer