diff options
author | Starla Insigna <starla4444@gmail.com> | 2011-08-24 11:53:40 -0400 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2011-08-24 11:53:40 -0400 |
commit | d8f00310e486aed1ab289a0f816acec571193c32 (patch) | |
tree | 5f2ce4b1a1187035514bcd4e3c8b0b0f17b7c12c /Classes/GameModeSelectionLayer.m | |
parent | 21294a54c49ab67e04898aac3482035bab6c79ae (diff) | |
download | cartcollect-d8f00310e486aed1ab289a0f816acec571193c32.tar.gz cartcollect-d8f00310e486aed1ab289a0f816acec571193c32.tar.bz2 cartcollect-d8f00310e486aed1ab289a0f816acec571193c32.zip |
Added support for multiple local highscore lists
This revision increments the database version to 2. Also fixed a small problem with GameModeSelection that aligned the highscore text incorrectly.
Diffstat (limited to 'Classes/GameModeSelectionLayer.m')
-rw-r--r-- | Classes/GameModeSelectionLayer.m | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/Classes/GameModeSelectionLayer.m b/Classes/GameModeSelectionLayer.m index 4c4845d..db08146 100644 --- a/Classes/GameModeSelectionLayer.m +++ b/Classes/GameModeSelectionLayer.m | |||
@@ -49,19 +49,7 @@ | |||
49 | 49 | ||
50 | if ([defaults boolForKey:@"hasDoneTutorial"]) | 50 | if ([defaults boolForKey:@"hasDoneTutorial"]) |
51 | { | 51 | { |
52 | const char* sqlQuery = "SELECT * FROM highscores ORDER BY score DESC LIMIT 1"; | 52 | collectSelection = [GameModeSelection selectionWithName:@"Collect" location:@"Paris" filename:@"paris" unlocked:YES]; |
53 | sqlite3_stmt* compiled_statement; | ||
54 | int score = 0; | ||
55 | |||
56 | if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK) | ||
57 | { | ||
58 | if (sqlite3_step(compiled_statement) == SQLITE_ROW) | ||
59 | { | ||
60 | score = sqlite3_column_int(compiled_statement, 2); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | collectSelection = [GameModeSelection selectionWithName:@"Collect" location:@"Paris" filename:@"paris" highscore:score]; | ||
65 | } else { | 53 | } else { |
66 | collectSelection = [GameModeSelection selectionWithName:@"Collect" location:@"Paris" filename:@"paris" unlockCondition:@"Beat the tutorial!"]; | 54 | collectSelection = [GameModeSelection selectionWithName:@"Collect" location:@"Paris" filename:@"paris" unlockCondition:@"Beat the tutorial!"]; |
67 | } | 55 | } |