Summary
After learning how to program and make a game, we finally took a step back and learned about higher-level patterns that help us structure our project and code nicely. First, we learned about what programming patterns are in general. Then, we learned about the Event Bus, Object Pool, and State Machine patterns that can help us in different ways. These three are some of the widely used patterns in gaming and are applied outside of game development too.
From here, you can start to investigate more niche programming patterns, such as the following:
- Components, also known as Composition: https://gameprogrammingpatterns.com/component.html
- Commands: https://gameprogrammingpatterns.com/command.html
- Service Locators: https://gameprogrammingpatterns.com/service-locator.html
In the next chapter, we’ll look at the filesystem and learn how to save the state of our game so that our players can start a game from where they left off.