here is the answer i figured out. i mention it here so others can benefit from it. what i am doing in the above code is firing the pause button and also firing the play button but i never set the pause and play button to no when the other one is active. the code should be as follows:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint touchLocation = [touch locationInNode:_bgLayer];
[self moveZombieToward:touchLocation];
CGPoint location = [touch locationInNode:self];
SKNode *node = [self nodeAtPoint:location];
if (node == _pauseButton) {
[_pauseButton setTexture:[SKTexture textureWithImageNamed:@"pausebutton"]];
_pauseButtonPressed = YES;
_playButtonPressed = NO;
self.scene.paused = YES;
}
if (node == _playButton) {
[_playButton setTexture:[SKTexture textureWithImageNamed:@"playButton"]];
_playButtonPressed = YES;
_pauseButtonPressed = NO;
self.scene.paused = NO;
}
}
also an additional tip, i had to change the self.scene.view.paused = YES;
to self.scene.paused = YES;
since i only needed to pause the scene so when i set the _lastUpdateTime = 0;
it would stop the time and the player won't move while the game is paused. yay, one more step learnt in sprite kit.:)