title: C++ game, class design and responsibilities
body: <p>I've just read some related questions that came up when I typed the subject, so I'll try not to repeat those.</p>
  
  <p>I've recently started revisiting a learning project I started about two or three years ago - a C++ port of a Mega Man engine. Yes I used ripped sprites. I also am using a game engine library for drawing, music, and input.</p>
  
  <p>My original code was atrocious. While it could (but barely) be called OO, it missed the point entirely. I've starting adding things like interfaces and cut out a lot of repetitive code. There are some things I'm not sure about, because game design gets very complex at times.</p>
  
  <p>The object that represents my game library is currently global (I know globals are usually bad) because many objects may rely on it here and there for things like loading their art or music. What's the best way to go about pulling that object out of global scope, without having to pass fifty parameters to everything that would otherwise use it directly?</p>
  
  <p>Next question: As we all know, Mega Man shoots lots of little white projectiles. Currently, the Player object is responsible for the Projectile objects he fires, updating their position and such (literally, calling the Projectile::Update() method once for each shot, inside the Player::Update() method). Is this the wrong way to do it? My first improvement was have all of these objects implement a DrawnObject interface, so that my game can just draw everything. Doing the same thing for Updates would mean I take control of the projectiles away from Player and give it to some broader Game object. The reason I'm hesitant about this is that it feels like the God object antipattern. Or am I misunderstanding said antipattern? There is still additional complexity involved - the projectiles die if they leave the visible screen, so any call to update the projectile would require the caller to have access to the screen object.</p>
  
  <p>That's all for now, I'll come back with more problems when I reach them. End of first post!</p>