<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />

Navigation

</aside>

🏠 Home Page

Getting Started

Architecture

Level System

Characters & Vehicles

Run Mechanics

World Objects

Boosters & Modifiers

Progression & Economy

UI

Save & Debugging

Modules

Publishing

Reference

💰 Monetization (Ads & IAP)

<aside> 💡 Every run ends on a result page. UIRunResult is shown after a normal run. UILevelComplete is shown after the finish wall. Both count up the reward and offer a rewarded double.

</aside>

Subsystems

Normal run

  1. The character stops, crashes, splashes or fails. PlayerController.OnRunFinished fires.
  2. GameController calculates the reward and reports the distance to the Record Wall.
  3. The Flag rises at the end position of the run.
  4. After 0.75 seconds, UIGame hides and UIRunResult shows.
  5. The panel pops in and the reward counts up. A tap skips the animation.
  6. The buttons appear: x2 and Continue.
  7. Continue shows an interstitial (when AdsManager allows it) and passes the final reward to GameController.
  8. A fade overlay hides the reset. The run is prepared again and the start screen plays the coin cloud with the reward.

Level complete

  1. The character crosses the Finish Wall. PlayerController.OnFinishReached fires.
  2. GameController marks the level as completed, calculates the reward, freezes the camera, hides the HUD and plays the confetti and the level complete sound.
  3. After 2.5 seconds, UILevelComplete shows the distance, the time, the top speed, the coins and the reward.
  4. Continue credits the reward, saves the next level id and reloads the Game scene.

After the finish wall, the restart is not available. The run ends only by the level complete flow.

Reward

reward = round(distance * Money Per Distance * Income Multiplier) + coins collected in the run
Part Source
Distance PlayerController.DistanceTraveled along the launch direction.
Money Per Distance Game Data.
Income Multiplier ProgressionController.IncomeMultiplier: the IncomeMultiplier upgrade plus the pre-run modifier bonus.
Coins collected RunCoinsController.Amount. See ‣.

Double reward

The x2 button is visible only when a rewarded video is loaded and the reward is not doubled yet. After the ad completes, the reward is multiplied by two and the counter animates to the new value.

AdsManager.ShowRewardBasedVideo(OnDoubleAdCompleted);

Restart during the run

The restart button of UIGame ends the run without the result page. Coins of the run are dropped. When the run had already ended and the reward was calculated, the reward is added directly.

Nothing is credited on the result page

The pages do not change the balance. Continue hands the final reward to GameController, which adds it to the balance through the start screen coin cloud. A run closed in the middle loses the uncredited coins.

Level complete after the last level

GameController selects the first level when there is no next level. All levels stay unlocked on the progression page.

How to add a stat to the level complete page

  1. Add a TMP_Text field to UILevelComplete and assign it in the prefab.
  2. Add a parameter to SetResult.
  3. Pass the value from GameController.ShowLevelComplete.