From d8f00310e486aed1ab289a0f816acec571193c32 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Wed, 24 Aug 2011 11:53:40 -0400 Subject: 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. --- Classes/GameOverScene.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Classes/GameOverScene.m') 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 @@ textField.enabled = NO; submitSwitch.enabled = NO; - const char* sqlQuery = [[NSString stringWithFormat:@"INSERT INTO highscores (name, score) VALUES (\"%@\",%d)", [textField text], score] UTF8String]; + const char* sqlQuery = [[NSString stringWithFormat:@"INSERT INTO highscores (name, score, gameMode) VALUES (\"%@\",%d,\"Collect\")", [textField text], score] UTF8String]; sqlite3_stmt* compiled_statement; if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK) { sqlite3_step(compiled_statement); - NSLog(@"awesome, %@", [textField text]); + NSLog(@"awesome, %@, %d", [textField text], score); } else { - NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg([Cart_CollectAppDelegate database])); + NSLog(@"Error while adding highscore to local highscore list. '%s'", sqlite3_errmsg([Cart_CollectAppDelegate database])); } if (submitSwitch.on) -- cgit 1.4.1