Download

What is the best way to implement global variables?

What is the best way to implement global variables?
For instance if I want a variable that tells me if my mouse was clicked and want an access to it from several classes?
Till now I have used static variables but someone has told me that this is not the right way, So what is the right way?

You can create a Singleton for your global variables, you can store them in the GameMode (If its server only), Or store them in the GameState.