Summary
We have covered a lot of ground in this chapter. We have learned a pattern called the Observer pattern, and that one class is a broadcaster while other classes called observers can register with the broadcaster and receive updates. We used the Observer pattern to implement the first part of the user input by handling the play/pause button. We added a bit of action to the chapter when we also coded a ParticleSystem
class ready to spawn an explosion whenever the player destroys an enemy ship.
In the next chapter, we will learn other useful programming patterns, including one called the Entity-Component pattern and another called the Factory pattern. We will use them to code and build the player's ship, which will be able to shoot rapid fire lasers and will be able to zoom around with a city skyline scrolling smoothly in the background.