summary refs log tree commit diff stats
path: root/Classes/GameOverScene.m
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-08-24 11:53:40 -0400
committerStarla Insigna <starla4444@gmail.com>2011-08-24 11:53:40 -0400
commitd8f00310e486aed1ab289a0f816acec571193c32 (patch)
tree5f2ce4b1a1187035514bcd4e3c8b0b0f17b7c12c /Classes/GameOverScene.m
parent21294a54c49ab67e04898aac3482035bab6c79ae (diff)
downloadcartcollect-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/GameOverScene.m')
-rwxr-xr-xClasses/GameOverScene.m6
1 files changed, 3 insertions, 3 deletions
diff --git a/Classes/GameOverScene.m b/Classes/GameOverScene.m index bc081ff..94236ff 100755 --- a/Classes/GameOverScene.m +++ b/Classes/GameOverScene.m
@@ -88,15 +88,15 @@
88 textField.enabled = NO; 88 textField.enabled = NO;
89 submitSwitch.enabled = NO; 89 submitSwitch.enabled = NO;
90 90
91 const char* sqlQuery = [[NSString stringWithFormat:@"INSERT INTO highscores (name, score) VALUES (\"%@\",%d)", [textField text], score] UTF8String]; 91 const char* sqlQuery = [[NSString stringWithFormat:@"INSERT INTO highscores (name, score, gameMode) VALUES (\"%@\",%d,\"Collect\")", [textField text], score] UTF8String];
92 sqlite3_stmt* compiled_statement; 92 sqlite3_stmt* compiled_statement;
93 93
94 if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK) 94 if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK)
95 { 95 {
96 sqlite3_step(compiled_statement); 96 sqlite3_step(compiled_statement);
97 NSLog(@"awesome, %@", [textField text]); 97 NSLog(@"awesome, %@, %d", [textField text], score);
98 } else { 98 } else {
99 NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg([Cart_CollectAppDelegate database])); 99 NSLog(@"Error while adding highscore to local highscore list. '%s'", sqlite3_errmsg([Cart_CollectAppDelegate database]));
100 } 100 }
101 101
102 if (submitSwitch.on) 102 if (submitSwitch.on)