-This project replicates a Clash Royale-style Chest System using Unity. -It implements key design patterns such as MVC, Command, Observer, State Machine, and Service Locator. -It simulates spawning, unlocking, and collecting chests using Gems or wait timers.
The Flow Diagram is as follows: https://drive.google.com/file/d/1xCAlbsJ54CSMH4qcj_UZdUlbBpNrfsWl/view?usp=sharing
- Gameplay
- Features
- Installation
- Credits
Here, click the Start button in the Lobby, and then click the Generate Chest button once chests are spawned open them. Based on your choice either with coins and gems or wait for the timer to open them.
Gameplay Video: https://drive.google.com/file/d/1QpPdBOEVZDyJQ07huTUh_wJvh6P2O8NL/view?usp=sharing
Playable Link:
- Chest Spawning System: Adds chests into available slots with type-based logic (first unique, then random).
- Unlock System: Unlock chests either with time or instantly using Gems.
- Command Pattern: Allows actions like "Unlock with Gems" to be undone.
- Observer Pattern: UI updates automatically when a new chest is spawned.
- MVC Architecture: Separates data (Model), logic (Controller), and visuals (View) for better structure and testing.
- Service Locator: Provides global access to services like ChestSubject.
- Scriptable Objects: Stores chest data such as rewards, unlock time, and sprite dynamically via the Unity Editor.
- State Machine: Manages chest states: Locked, Unlocked, Unlocked, and Collected.
- Undo System: Undo the last Gems-spending action using a stack of commands.
- Slot Management: Supports 4 chest slots with logic to detect occupied or empty slots.
- Error Messaging: Shows popups for full slots, no available slots, or not enough Gems.
- Currency System: The player can earn and spend Coins and Gems.
- Random Rewards: Chest rewards are randomized within min-max ranges.
- Animations & Sounds: Uses sound feedback (clicks, warnings) for a better user experience.
- UI Integration: Uses TextMeshPro for real-time coin/gem updates and chest display.
- Clone the Repository
- Open the project in Unity's Latest Version
- Load the Main Menu
- Play!!
The credits goes to Outscal for the Project and my Mentor Shrish for his guidance