Sign in to follow this  
Toolmaker

Scene Management in 2D game

Recommended Posts

Toolmaker    967
I'm currently working on a 2D space game, and I'm up to the part where I can start developing my scene manager. However, I want to do this in such a fashion I can reuse the manager in later games(Which there will be). I've discussed this issue with a friend, and came up with this design: All game objects are derived from a generic CSceneObject base class. So, both PlayerShip and EnemyShip will be derived from this. During update of the game, I call SceneManager->Update(FrameTime,...) to update all objects and do collision detection. And this is where the problems arise. For instance, if the collision is with a bonus object the collision is obviously different then when it's with a Plasma Burst shot. I was thinking of doing something along the lines of: pCheckedObject->Collision(pCollisionObject) This will tell pCheckedObject that is collided with pCollisionObject. And then inside the Collision function(Which is pure virtual in the cOBject class) I can handle the correct reaction to this. So far, so good. But how on earth am I getting a enum ObjectType into my cObject class? Do I template it, and when creating a new object, I call new cAlienShip<ObjectType>? I'm kinda confused here... Toolmaker

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this