A Unity-based wheel of fortune mobile game featuring progressive zones, strategic risk-reward mechanics, and clean architecture implementation.
- Progressive Zone System: Three difficulty zones (Bronze, Silver, Gold) with increasing rewards and bomb chances
- Wheel Spinning Mechanics: Smooth DOTween-based animations with customizable spin outcomes
- Bomb & Revival System: Strategic risk-reward gameplay with revival options
- Reward Collection: Track and collect multiple reward types (currency, items)
- Haptic Feedback: Platform-specific vibration patterns (iOS/Android)
- Audio System: Dynamic music and SFX with fade transitions
- Cheat System: Development tools for testing specific outcomes and zones
- Clean Architecture with clear separation of concerns
- Dependency Injection for testability and maintainability
- State Machine for game flow management
- Object Pooling for performance optimization
- Event-driven architecture for loose coupling
The project follows a clean architecture approach with clear separation of concerns:
Assets/_Game/Scripts/
├── View/ # UI components and visual presentation
├── Presentation/ # Presenters, adapters, and installers
├── Infrastructure/ # Core services, DI, factories, interfaces
├── Data/ # ScriptableObjects and data models
└── Core/ # Business logic, services, state machine
| Layer | Responsibility |
|---|---|
| View Layer | MonoBehaviour components for UI/visual elements |
| Presentation Layer | Mediates between View and Core using Presenter pattern |
| Core Layer | Game logic, state management, and business rules |
| Infrastructure Layer | Cross-cutting concerns (DI, pooling, factories) |
| Data Layer | Configuration and runtime data models |
- Factory Pattern:
GameFactoryfor creating game context and dependencies - Object Pooling:
RewardItemPoolfor efficient reward view management
- Adapter Pattern:
WheelViewAdapter,WheelSpinServiceAdapterfor interface adaptation - Facade Pattern:
ScreenServiceFacadefor simplified screen management
- State Machine:
WheelGameStateMachinewithPlayingStateandBombState - Strategy Pattern: Zone-specific strategies (
BronzeZoneStrategy,SilverZoneStrategy,SuperZoneStrategy) - Observer Pattern: Event-driven communication between View and Presenters
- Service Locator:
ServiceLocatorfor dependency resolution - Dependency Injection: Constructor injection throughout the core services
- MVP (Model-View-Presenter): Clear separation between UI and business logic
Wheel-Of-Fortune/
├── Assets/
│ ├── _Game/
│ │ ├── Art/ # Visual assets (sprites, UI, wheel graphics)
│ │ ├── Audio/ # Music and sound effects
│ │ ├── Data/ # ScriptableObjects (rewards, zones, profiles)
│ │ ├── Prefabs/ # Reusable game objects
│ │ ├── Scenes/ # Unity scenes
│ │ └── Scripts/ # C# source code
│ │ ├── Core/ # Business logic
│ │ ├── Data/ # Data models
│ │ ├── Infrastructure/ # Services and DI
│ │ ├── Presentation/ # Presenters and adapters
│ │ └── View/ # UI components
│ └── Plugins/
│ └── Demigiant/
│ └── DOTween/ # Animation library
└── ProjectSettings/ # Unity project configuration
- Bronze Zone: Lower risk, smaller rewards
- Silver Zone: Medium risk, medium rewards
- Gold Zone: Higher risk, larger rewards
- Animated wheel spins using DOTween
- Configurable spin duration and easing
- Visual feedback on outcome
- Random bomb appearances increase with zone difficulty
- Revival options available
- Strategic decision-making element
The project includes a cheat system for development and testing:
- Force specific zone selection
- Control spin outcomes
- Test reward systems
- Debug state machine transitions
Unity Assets:
- DOTween by Demigiant
- TextMesh Pro by Unity Technologies
⭐ Star this repo if you find it interesting!
