Chapter overview
This chapter is all about learning how to decouple code using the Observer pattern. This chapter is a little different than the others because it isn't about using the Observer pattern to solve one big pattern; it is about learning to apply it to the many little situations that lead to sloppy code throughout a game's development. The Observer pattern will show you that there is a better way.
First, we will explore the inevitable situation of gameplay code leaking into our engine code. Then, we will learn about the Observer pattern and how it can improve these situations. Along the way, we will look at some example code from the Mach5 Engine. However, since this pattern has so many uses, we will focus on how it can be incorporated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access