Jump to content
  • Advertisement
Sign in to follow this  

Scene Management in 2D game

This topic is 5469 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'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
Sign in to follow this  

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