Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ReaperX

How do I access a single object from multiple objects efficiently?

This topic is 5941 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!