I cant figure out how to display the score of my game on the GameOver scene. Both the GamePlay and GameOver scenes have the same scoreLabel set up.
GamePlay.m
score = 0;
scoreLabel = [CCLabelTTF labelWithString:@"0" fontName:@"Marker Felt" fontSize:50];
scoreLabel.position =CGPointMake(screenSize.width/2,screenSize.height/1.1);
scoreLabel.color=ccc3(240, 255, 255);
[self addChild:scoreLabel z:1];
-(void)addPoint{
score=score +1;
[scoreLabel setString:[NSString stringWithFormat:@"%i", score]];
}
GameOver.m
CGSize screenSize=[CCDirector sharedDirector].winSize;
scoreLabel = [CCLabelTTF labelWithString:@"%d" fontName:@"Marker Felt" fontSize:50];
scoreLabel.position =CGPointMake(screenSize.width/2,screenSize.height/1.1);
scoreLabel.color=ccc3(240, 255, 255);
[scoreLabel setString :[NSString stringWithFormat:@"%i", score]];
[self addChild:scoreLabel z:1];
What am I doing wrong?