A highly modular implementation of the classic 2048 puzzle game, developed in Unity/C#. This project serves as a technical showcase for custom Unity Editor extensions, event-driven architecture, and automated grid generation.
The standout feature of this project is the custom Inspector tool. Instead of manually placing tiles, I developed a Board Data Editor that allows developers to:
- Dynamically resize the grid (Rows/Columns) via the Inspector.
- Toggle individual cell states using an interactive boolean toggle matrix.
- Automate Grid Persistence: Uses
ScriptableObjectsto save level configurations, separating game data from logic.
I utilized the company's custom EventSystem (via Holago.SystemContainer) to decouple game components.
- Input vs. Logic:
InputHandler.cscaptures gestures and broadcasts events, ensuring that theBoardManagerdoesn't need to "poll" for input. - State Management: Actions like
OnMovesCompletedandOnMergeStartedtrigger UI updates and sound-ready hooks without direct class dependencies.
- Factory Pattern (
TileFactory.cs): Used to abstract the instantiation of tile prefabs, ensuring consistent initialization. - Separation of Concerns: Distinct controllers for
Cells,Tiles, andInputensure the codebase is modular and easy to debug. - Tween-Based Feedback: Integrated DOTween for optimized, non-blocking animations (scaling and movement), providing a polished "juice" to the user experience.
- Recursive Grid Traversal: Implemented a robust movement algorithm in
BoardManager.csthat handles multi-tile shifts and merges in a single directional swipe. - Dynamic Spawn Logic:
TileGenerator.csmanages empty-cell detection and weighted random spawning of new tiles.
- Language: C#
- Engine: Unity
- Tooling: Unity Editor Scripting (
CustomEditor) - Libraries: DOTween (Animation Management)