diff options
Diffstat (limited to 'Classes/GameOverScene.m')
-rwxr-xr-x | Classes/GameOverScene.m | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Classes/GameOverScene.m b/Classes/GameOverScene.m index 94236ff..f2dca0b 100755 --- a/Classes/GameOverScene.m +++ b/Classes/GameOverScene.m | |||
@@ -14,12 +14,12 @@ | |||
14 | 14 | ||
15 | @implementation GameOverScene | 15 | @implementation GameOverScene |
16 | 16 | ||
17 | + (GameOverScene*)sceneWithScore:(int)score | 17 | + (GameOverScene*)sceneWithScore:(int)score gameMode:(NSString*)gameMode |
18 | { | 18 | { |
19 | return [[[GameOverScene alloc] initWithScore:score] autorelease]; | 19 | return [[[GameOverScene alloc] initWithScore:score gameMode:gameMode] autorelease]; |
20 | } | 20 | } |
21 | 21 | ||
22 | - (id)initWithScore:(int)score2 | 22 | - (id)initWithScore:(int)score2 gameMode:(NSString*)gameMode2 |
23 | { | 23 | { |
24 | self = [super init]; | 24 | self = [super init]; |
25 | 25 | ||
@@ -36,6 +36,7 @@ | |||
36 | [theLayer addChild:backgroundImage z:0]; | 36 | [theLayer addChild:backgroundImage z:0]; |
37 | 37 | ||
38 | score = score2; | 38 | score = score2; |
39 | gameMode = gameMode2; | ||
39 | 40 | ||
40 | movingLayer = [[UIView alloc] initWithFrame:CGRectMake(0, -320, 480, 320)]; | 41 | movingLayer = [[UIView alloc] initWithFrame:CGRectMake(0, -320, 480, 320)]; |
41 | movingLayer.backgroundColor = [UIColor clearColor]; | 42 | movingLayer.backgroundColor = [UIColor clearColor]; |
@@ -88,7 +89,7 @@ | |||
88 | textField.enabled = NO; | 89 | textField.enabled = NO; |
89 | submitSwitch.enabled = NO; | 90 | submitSwitch.enabled = NO; |
90 | 91 | ||
91 | const char* sqlQuery = [[NSString stringWithFormat:@"INSERT INTO highscores (name, score, gameMode) VALUES (\"%@\",%d,\"Collect\")", [textField text], score] UTF8String]; | 92 | const char* sqlQuery = [[NSString stringWithFormat:@"INSERT INTO highscores (name, score, gameMode) VALUES (\"%@\",%d,\"%@\")", [textField text], score, gameMode] UTF8String]; |
92 | sqlite3_stmt* compiled_statement; | 93 | sqlite3_stmt* compiled_statement; |
93 | 94 | ||
94 | if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK) | 95 | if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK) |