I have just finished my own little polished clone of Araknoid/Breakout, and I was wondering if anyone would mind reviewing parts of my code.
I want to know if my usage of "global" variables is proper. Right now I have a class in globals.hpp that has many public static members of things that I use around my program; resource managers, input managers, etc. Any class that includes "globals.hpp" has access to all of these files. I did this because I really don't want to be passing objects through classes that don't need them just to give them to something else
The other part of my code I want to hear about is my observer pattern. Currently I have an observer pattern with observers and the dispatcher. Many objects inherit from observer and then subscribe to events that can occur. I am wondering if I am using this to liberally, or if it's fine.
Thanks in advance!
Code:
https://github.com/TheCandianVendingMachine/Breakout_TCVM/tree/master/srcParts in question:
Globals - game/globals.hpp
Observer pattern - managers/events
Use of an observer - states/gameState.hpp