Alright sat down to write a bit of a story:
cc: @sick hill
Objectives:
- Reduce/Eliminate Singletons
- Increase Modularity
- Components independent of systems of the game
Objective: Reduce/Eliminate Singletons
" I want to reduce reliance on singletons because they create hidden dependencies, making it hard to reuse or test components. When a script depends on a singleton like GameManager.Instance, it implicitly requires a specific runtime environment, which reduces flexibility and makes unit testing difficult without mocking or replicating the full game context."
Objective: Modularity
"One of my main priorities is modularity. I aim to design components and game objects that are self-contained and can function independently of the scene or game context they’re in. Ideally, any object should be reusable in other scenes or projects without needing global state, specific scene setups, or singletons to function properly."
Objective: GameObject & Component Independence
Specifically, I'm running into an issue where I want objects to be independent of each other, but they end up implicitly depending on shared systems like the score system.
For example, collecting a power-up might increase a score multiplier. This creates a direct dependency between the power-up object and something that manages score, whether it's a ScoreManager, singleton, or another global system. That means the power-up can no longer function in isolation—it assumes a score system must exist.
This breaks modularity. I want the power-up to work even in contexts where no score system is present.
For example, in a prototype scene, a tutorial level, or a completely different game mode. Its behavior (e.g. applying a multiplier) should be decoupled from the specific implementation or even the existence of a scoring system