Game Scene Management questions

Game Scene Management questions
0.0 0



I am currently trying to create visual controls for my game’s core gameplay. I have some general questions as to how to achieve this in the most elegant fashion.

At the moment my main game scene consists of a main “void” layer (A CCParallaxNode) which I add the different layer elements to. These elements include a layer for the background, a layer for the player and a layer for the controls. My goal is to have each of those layers do a dedicated job instead of centrally handling everything from the main game scene’s class.

For example, my controls layer will place control Sprites on the screen. The control layer’s job is to look and see if I am touching that Sprite (and not anywhere else on screen). If this button is touched, the player should react. Now, since my controls layer does not know anything about a player, nor anything about the actual game scene, I need to somehow connect those up. What is the preferred object oriented way to handle this situation? I should mention that I cannot use a CCMenu class because I need to check if any control button is being held, not just touched.

Thank you for your time,