Game developers today mostly prefer an approach called Entity-Component-System (ECS), so look that up. Many will say that this is a completely different paradigm compared to OO, but I'm not convinced, cause although it looks very different, when you sort of "squint at it" the right way, it's not as different as it seems - what's different about it is that it's based on design constraints that your typical OO examples out there aren't considering. Even in OO, not every object needs to know how to render itself. Some things can just be data for other things to use. Use ECS for inspiration.
↧