title: Help Logically setting up Layers for Good Game Design (involving SpaceManager Physics, Music, and Game Logic)
body: <p>Im in the middle of creating my first iPhone game - I have a background in OOP and in particular C++ so I had some questions with regards to how best to logically setup layers while maintaining functionality.</p>
  
  <p>Currently I WANT for my game to have three main layers:</p>
  
  <ul>
  <li>HUDLayer (All static objects on the screen are here - game controls, User score, pause button etc.)</li>
  <li>PlayLayer (The Player, the main game loop and all of the game logic here)</li>
  <li>Level Layer (The level images and the level physics objects that the player interacts with, and the background music specific to this level)</li>
  </ul>
  
  <p>Notice I used the word WANT here - because for the life of me im constantly having to move logical objects around just to work within what appears to be Cocos2d's and spacemanagers structure.</p>
  
  <p>Below are just some of the issues that I'm facing</p>
  
  <ul>
  <li>I would like for my PlayLayer to be the scene thats loaded by the director - but if I do that then all of the HUDLayer objects get covered behind the PlayLayer, and dont stay in place like they should, hence the HUDLayer is my scene and I have had to do that just to make it work</li>
  <li>I would like to play the background music (via simpleAudioEngine playBackgroundMusic) in the LEVEL layer because I want different levels to have different music.  So far the ONLY way I have gotten background music to work is to have it in the TOP most layer i.e. in this case the HUDLayer</li>
  <li>Because of the fact that I have to use an instance of the SpaceManagerCocos2d object to create physics bodies - it seems like my level layer has to be killed and just incorporated within my PlayLayer otherwise im having a nightmare of a time attempting to detect collisions between the player and the level.</li>
  </ul>
  
  <p>Am I missing something very obvious here?  is there a core understanding of layers that Im just not getting?  More and more I feel like im being pushed by the framework to build the whole game inside of a single class and just to use layers as scenes.</p>
  
  <p>Is anyone else having these problems?  Am I approaching the architecture of the game wrong?  Any help would really be appreciated.</p>
  
  <p>Thanks in advance guys!</p>