How do I make it that green.png color always stays saved in the game. When game ends, green goes back to the original color and it's not saved. So I have to click on green all the time before the game. I want it to be saved always when the user clicked it once, unless the user clicks a different color.
MAN = BOOLEAN
if ((dude.center.x < 100) && (CGRectIntersectsRect(dude.frame, ground.frame)) &&(MAN==YES)) {
dude.image=[UIImage imageNamed:@"green.png"];
[[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"save"];
MAN= [[NSUserDefaults standardUserDefaults]boolForKey:@"save"];
[[NSUserDefaults standardUserDefaults]synchronize];
}
The BELOW code for saving BOOL isn't working at all.
[[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"save"];
MAN= [[NSUserDefaults standardUserDefaults]boolForKey:@"save"];
[[NSUserDefaults standardUserDefaults]synchronize]; //iOS 7
//Not using [[NSUserDefaults standardUserDefaults]synchronize]; for iOS 8
Is there a different way to save BOOL?