Archived

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

hammerstein_02

Design of a shootemup

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
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