How do I access a single object from multiple objects efficiently?
I want almost all my objects to be able to access a class that handles sprites and draws them to the screen or a class that stores and sorts gameworld events. What would be the most efficient way to handle this in c++? Is there any flaw in this idea and is there a better way to get my objects to interact with the screen or each other?
thanks for any help.
So you think if I spawn a load of monster objects that I should pass each one a pointer when its loaded? What if the monsters are part of another class, should I pass the pointer to that class first? I was thinking of using a static object (if there is such a thing). I suppose i could multiple inherit a static pointer to all drawable objects. Is there a better method?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement