Fixing A Game Breaking Bug or How I Learned to Love The Observer Pattern
Fixing A Game Breaking Bug or How I Learned to Love The Observer Pattern By Pedro Colon Wooooo boy, this took a bit. Technically-as the time of this writing-I am not completely done with fixing the game breaking bug BUT for the most part the system is working as intended (for the most part), just need to start placing it around the current tracks we have for the game. So what was- The Problem! The problem is honestly quite simple. When the player starts, they are able to turn back and hit the lap three times to end the race in seconds. This is obviously not great for a kart racing game as this would just be game breaking as seen below: This is bad, like just bad. Absolutely unfun and unsatisfying for everyone involved. So now the question is, how did I manage to get the bug fixed? The answer is quite simple: A design pattern known as the Observer Pattern. Observer Pattern is The Best! I am not kidding when I say that the observer pattern is awesome. I remember in one of my c...