Lunatic
2005.09.04, 09:26 PM
Hi All,
I've been slowly chugging along in my SDL game learning process, but a problem is becoming more apparent as my game becomes more and more complicated.
I've been basing the design in my head along the lines of having each "area" managed by a Manager class to organise smaller elements. I.e. A Player Manager, GUI Manager etc.
Things started to get problematic, once I had gui elements trying to access player objects, but not being able to see the player manager (I declared the Player Manager object in main()). I've tried to declare the Player Manager outside of main as a global variable, etc but i usually end of getting undefined symbol errors.
My question is: Should I persist in this line of design? Is having manager classes a good idea? or is there some other idea I should follow? If it is the best idea, is there some way of making C++ classes globally accessible to all?
Thanks in advance for any suggestions.
(C++, Latest SDL, XCode 2.0, Tiger OSX)
I've been slowly chugging along in my SDL game learning process, but a problem is becoming more apparent as my game becomes more and more complicated.
I've been basing the design in my head along the lines of having each "area" managed by a Manager class to organise smaller elements. I.e. A Player Manager, GUI Manager etc.
Things started to get problematic, once I had gui elements trying to access player objects, but not being able to see the player manager (I declared the Player Manager object in main()). I've tried to declare the Player Manager outside of main as a global variable, etc but i usually end of getting undefined symbol errors.
My question is: Should I persist in this line of design? Is having manager classes a good idea? or is there some other idea I should follow? If it is the best idea, is there some way of making C++ classes globally accessible to all?
Thanks in advance for any suggestions.
(C++, Latest SDL, XCode 2.0, Tiger OSX)