← Back to projects

Android wheel game · Unity 2021.3

Gamble Wheel

A push-your-luck wheel-of-fortune game for Android, built with Unity 2021.3 LTS and C#. Spin for growing rewards, risk a bomb that wipes the run, and cash out only on bomb-free zones.

Overview

In every zone the player spins a wheel full of rewards and one bomb. Rewards grow as the player advances, and hitting the bomb loses everything collected so far.

Every 5th zone is a bomb-free silver safe zone, and every 30th is a bomb-free golden super zone with special rewards. The player can cash out only in these zones, and only while the wheel is not spinning.

After hitting a bomb, the player can pay in-game currency to revive and continue. The APK is available from GitHub Releases.

Zones

Zone type decides whether the wheel can contain a bomb and whether the player is allowed to leave with their rewards.

Architecture

Game rules live in a core layer of plain C# with no dependency on Unity. The UI is built on the MVP (Model–View–Presenter) pattern.

Views are passive components that only report user actions through C# events. The presenter talks to them through interfaces, and all dependencies are wired in a single composition root.

Assembly Definitions separate the layers, so the compiler enforces the direction of dependencies. Wheel slices, zone progression, and rewards are ScriptableObjects that can be edited without writing code.

Animation & UI

All animation is done with DOTween.

  • Wheel spin, with the indicator ticking past each slice
  • Rewards flying from the wheel into the rewards panel
  • Popup transitions and card shake effects

Text uses TextMeshPro. Sprite Atlases reduce draw calls, and 9-sliced sprites keep images from stretching. With the Canvas Scaler in Expand mode and proper anchoring, the UI displays correctly on 20:9, 16:9, and 4:3 screens.

Editor tools

  • Scene builder

    Sets up the scene from code through SerializedObject.

  • Hierarchy validator

    Checks UI rules such as naming, unneeded raycasts and masks, and button events assigned in the editor.

  • Capture tool

    Takes screenshots at 20:9, 16:9, and 4:3.

  • Build tool

    One-click IL2CPP / ARM64 APK build.

Code quality

NUnit unit and EditMode tests cover the game rules and the presenter flow. The code uses interfaces, Action-based events, IReadOnlyList for read-only data, IDisposable helpers, fields encapsulated with [SerializeField], and buttons wired from code in OnValidate. The repository is public and versioned with Git LFS.

Technologies

Unity 2021.3 LTS C# DOTween TextMeshPro Sprite Atlas ScriptableObjects MVP NUnit IL2CPP Git LFS

Features