Jump to content
  • Advertisement

Archived

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

hammerstein_02

Design of a shootemup

This topic is 5782 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 presume this belongs in game programming, not in game design, my apologies if I am wrong.. but... So far, my game structure stands at this.. a cManager object is created to initialise the graphics etc and create other game objects. I have a basic cObject class with cPlayer and cEnemy derived from that. I have a cObjectManager ll, to which I add all the objects and just call its update function every frame to loop through and do all game stuff. Now I want to create cBullet, which should be a cObject, but also needs to contain a pointer to its owner (so it can do updating, ie. if the owner was a player need to add points) so I need, when I create a bullet to set an owner, and then when it collides decide what it hit.. Is my design flawed or can I put something in to manage this feat? Thanks for your time =*= If things seem bad, think that they can get a whole load worse, and they don''t seem so bad anymore =*=

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I use this a lot (pseudo):


class ObjManager
{//stuff}

class ManagedObject
{
ObjManager* Manager;
}

ObjManager::AddManagedObject( ManagedObject* someobj )
{
someobj->Manager = this;
}

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!