title: Spawning/instantiating projectiles in games: organisation of aggregation/composition/association
body: <p>I'm trying to organised a good OO model for a game (being written in C#/XNA) but am uncertain of the 'best' way to deal with players, projectiles, enemies, and the environment. The main classes involved will be : level, player, tilemap, enemy, projectile. Which of the following would be, in general, the best option?</p>
  
  <ol>
  <li><p>A 'level' class with a 'player' object, 'tilemap' object and lists of 'projectile' objects and 'enemy' objects, keeping ownership info for projectiles and iterating through the projectile list to check collision.</p></li>
  <li><p>A list of 'projectile' objects in the base class of the 'player' and 'enemy' classes. These lists can be iterated through in the 'level' class. In this case I believe that dead players and enemies can't be destroyed until their projectile lists are empty.</p></li>
  </ol>
  
  <p>Option 1's composition of projectiles in the level makes more sense to me, and is my current working method: when a player shoots, a flag is set and the projectile they fired is recorded. This flag is checked in the level class and the projectile is added to the list.</p>
  
  <p>Additionally, in the case of option 1, what is the disadvantage of making the projectile list public shared so it can be easily added to?</p>
  
  <p>Thank you.</p>