Created
April 17, 2011 18:35
-
-
Save alinradut/924332 to your computer and use it in GitHub Desktop.
Achievements - Games won
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)updateGamesWon { | |
| gamesWonInARow_++; | |
| if (gamesWonInARow_ && (gamesWonInARow_ % 10 == 0 || gamesWonInARow_ == 5)) { | |
| NSInteger bonus = score_* ((float)gamesWonInARow_ / 100); | |
| score_ += bonus; | |
| NSString *achievement = [NSString stringWithFormat:@"%d games in a row! (+%d)", gamesWonInARow_, bonus]; | |
| [self achievementUnlocked:achievement]; | |
| } | |
| [scoreLabel_ setString:[NSString stringWithFormat:@"Score: %d", score_]]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment