I have some difficulties making the level change only once when the player has reach a certain score during the game. It keeps changing every time the players gets a new score which is very annoying.
//Change the level
if(score >= 600){
level = level+1;
[levellabel setString:[NSString stringWithFormat:@"%d",level]];
id ScaleUp = [CCScaleTo actionWithDuration:0.3 scale:14.0 ];
id ScaleDown = [CCScaleTo actionWithDuration:0.3 scale:1.0 ];
[levellabel runAction:[CCSequence actions:ScaleUp, ScaleDown, nil] ];
}
I also tried with setting the if statement to if(score >= 600 && score<1000) and then use a new if statement telling it to change the level once again when the score >=2000 but if I do that nothing seems to happen.
What am I doing wrong?
The following if you have a control over the levels and a max cap on the levels..
if its infinite and follows a standard formula, in this example, increase level for every 1000 score, it should be: