This design pattern will help you make sense of your game design as it gets bigger.
You can listen to episodes 77, 86, 87, and 88 for more information and background. This episode will start tying things together. I didn’t originally describe this because it really is a merging of many patterns. But as I started coding this myself, I’ve realized that there’s more to it than just sticking a few design patterns together. Enough that you can benefit from a description.
Here’s the big picture. Your game will likely have many characters and objects in it. The characters can be directly controlled by one or more players or be controlled by the game as either direct opponents or just background characters.
And the objects can be almost anything that your character interacts with. This could be a weapon, or an apple, or a door or table. All of these characters and objects share certain abilities and behaviors. That’s normally a good sign to use inheritance in your design. But if you go that way, you’ll find that inheritance leads to large and complicated hierarchies of classes that are difficult to change.
Listen to the full episode to learn more about how the patterns work together to keep your game design understandable as it gets bigger.