This is a Mario game built in Unity using C# and adhering to SOLID principles for better code maintainability and flexibility. The project is organized into several folders, each serving a specific purpose.
Contains interfaces defining the contracts for various game components:
- IBullet: Interface for defining bullet behavior.
- ICharacter: Interface for character behavior.
- ICollectible: Interface for collectible items.
- IWeapon: Interface for weapon behavior.
Houses concrete implementations and abstract classes:
- SC_Concrete_Bullets: Implements
IBullet
with bullet behavior. - SC_ConcreteCharacter: Abstract class implementing
ICharacter
providing a base for character-related functionality. - SC_ConcreteCollectible: Implements
ICollectible
defining collectible behavior. - SC_ConcreteCollectibleManager: Manages interactions between collectibles, weapons, and the UI Canvas.
- SC_ConcreteDeadPlatform: Implements logic for platforms causing character death.
- SC_ConcreteWeapon: Implements
IWeapon
with weapon behavior.
Contains specific implementations for game objects:
- SC_Enemy: Extends
SC_ConcreteCharacter
to represent enemy characters with weapon capabilities.
Includes scripts managing different aspects of the game:
- CollectiblesManagers Folder: Houses managers for each collectible type, extending
SC_ConcreteCollectableManager<T>
. - General Managers: Other scripts managing broader aspects of the game.
- Single Responsibility Principle (SRP): Each class has a single responsibility, promoting maintainability.
- Open/Closed Principle (OCP): The system is open for extension but closed for modification, facilitating future updates.
- Liskov Substitution Principle (LSP): Derived classes can be substituted for their base classes, enhancing flexibility and modularity.
To get started with the game, clone this repository and open it in Unity. Ensure you have Unity installed, and then run the project to start playing.
- Gilad Meir
Sprites have been taken from Google.
Feel free to use and modify it according to your needs.
For more details on each component and how they contribute to the game, please refer to the respective folders and scripts in the repository.
Enjoy playing Mario in Unity with SOLID principles!