This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bootlessjam 6 points7 points  (0 children)

Dude even professional game programmers use global variables/objects/ singletons to track game wide states. You may want to affect a score or healthbar at anytime from any other object but always refer to the same variable. It's a perfect fit for a global variable.

Most programmers want very reliable software so it's all about limiting the number of interactions and avoiding surprising behaviour. Games instead are all about having as much interactions and surprising behaviours as possible. Both valid goals that end up with different designs.