I have a game scene which has 2 layers as shown below , when the user taps the Pause button am adding a Pause window layer as a child to Status bar layer. Game is in progress so till now what I have implemented was loaded a sprite into my Game layer and moving the sprite to the location wherever the user touches.
As far as touch handling on "game layer" goes, everything works perfect until the user taps pause button , the problem am getting is "Game layer" touch is active even after calling [[CCDirector sharedDirector] pause]
. Am still able to move my player around the screen in pause mode.
Please clarify what is the relation between Director pause and Touch?
Scene : Game scene has 2 Child
- GameScene
- Status Bar Layer #1
- Pause Button
Tap
{
[[CCDirector sharedDirector] pause]
Add pause Window to Status bar layer;
}
- Score Label
- Life Status icon
- Game Layer #2
Layer : Pause CCLayer
- PauseGameLayer
- Resume Button
Tap
{
Remove this layer from parent
[[CCDirector sharedDirector] resume];
}
- Restart Level
- Main menu