4 ms·
> As far as a game is concerned, there is only one audio system, one input system, one physics world, one deltaTime, one renderer, one asset loader. I thought
by mrkeen 3y ago
> As far as a game is concerned, there is only one audio system, one input system, one physics world, one deltaTime, one renderer, one asset loader.
I thought this way when I was doing Java dev around 10 years ago. I thought it excused the singleton pattern. I was wrong!
You should always be able to construct an object by explicitly passing dependencies to it. Especially for testing.
It really is no fun if your renderer starts talking to your asset loader and timer directly.
- DarkNova6 3y agoAll praise our almighty lord that is dependency injection
- Xeamek 3y agoNo. You don't need ability to DI every single functionality. And you can still do DI with global state, just with less granularity.
- astrange 3y agoPeople should get more into integration tests. If you start out thinking you need to separate everything for unit testability, you instantly get architecture astronaut-ism, where your architecture is entirely based on fake testability instead of the thing it's actually meant to do in production.
- deleted 3y ago[deleted]
- Capricorn2481 3y agoUnit testing in Game dev is largely useless.