At 12/22/10 09:48 PM, zrb wrote:
Not really, that just depends on how you want to work.
No it's not.
Abusing static variables like that leads to horrible code.
You will have so many and tight dependencies that using any class will be useless effort.
You only get a benefit of classes if you apply the ideas of oop. If you don't, you're just dumping code into several files. You will soon realise that this takes away most of the reusability/modularity classes can grant you.
Your main class can have a private variable "score", only this class should change the score.
You most likely want to have your main class listen for Events of the game elements and react accordingly. (for example increase the score)
If each and everyone can change each and everything, you are screwed!