From afeca7fa37f0aa578a9a44489b3862ba3aff9a26 Mon Sep 17 00:00:00 2001 From: exterlulz Date: Sat, 21 Aug 2010 17:53:00 +0200 Subject: [PATCH] add koko_pac, and clean some stuff --- kokogems.xcodeproj/project.pbxproj | 8 ++++---- src/GameController.m | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/kokogems.xcodeproj/project.pbxproj b/kokogems.xcodeproj/project.pbxproj index d164302..1681ace 100644 --- a/kokogems.xcodeproj/project.pbxproj +++ b/kokogems.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - CD4BECD4122023F800D72AC4 /* gems in Resources */ = {isa = PBXBuildFile; fileRef = CD4BECBA122023F800D72AC4 /* gems */; }; + CD4BED6A12202C8A00D72AC4 /* gems in Resources */ = {isa = PBXBuildFile; fileRef = CD4BED4F12202C8A00D72AC4 /* gems */; }; CD6C947C121EC6920033B9EF /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = CD6C947B121EC6920033B9EF /* icon.icns */; }; CD6C947E121EC6E10033B9EF /* gpl2.licence.txt in Resources */ = {isa = PBXBuildFile; fileRef = CD6C947D121EC6E10033B9EF /* gpl2.licence.txt */; }; CD6C9481121EC8B50033B9EF /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD6C947F121EC8B50033B9EF /* Preferences.xib */; }; @@ -56,7 +56,7 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 8D1107310486CEB800E47090 /* kokogems-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "kokogems-Info.plist"; sourceTree = ""; }; 8D1107320486CEB800E47090 /* kokogems.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = kokogems.app; sourceTree = BUILT_PRODUCTS_DIR; }; - CD4BECBA122023F800D72AC4 /* gems */ = {isa = PBXFileReference; lastKnownFileType = folder; name = gems; path = resources/gems; sourceTree = ""; }; + CD4BED4F12202C8A00D72AC4 /* gems */ = {isa = PBXFileReference; lastKnownFileType = folder; name = gems; path = resources/gems; sourceTree = ""; }; CD6C947B121EC6920033B9EF /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = icon.icns; path = resources/icon.icns; sourceTree = ""; }; CD6C947D121EC6E10033B9EF /* gpl2.licence.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = gpl2.licence.txt; path = resources/gpl2.licence.txt; sourceTree = ""; }; CD6C9480121EC8B50033B9EF /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = ""; }; @@ -164,7 +164,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - CD4BECBA122023F800D72AC4 /* gems */, + CD4BED4F12202C8A00D72AC4 /* gems */, CD6C9675121EEFE30033B9EF /* backgrounds */, CD6C94B8121ECA5D0033B9EF /* continue.png */, CD6C94B9121ECA5D0033B9EF /* cross.png */, @@ -283,7 +283,7 @@ CD6C9651121EEF6D0033B9EF /* background.png in Resources */, CD6C9680121EEFE30033B9EF /* backgrounds in Resources */, CD6C9715121F040F0033B9EF /* about_title.png in Resources */, - CD4BECD4122023F800D72AC4 /* gems in Resources */, + CD4BED6A12202C8A00D72AC4 /* gems in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/GameController.m b/src/GameController.m index 44c0da2..d2b52d2 100644 --- a/src/GameController.m +++ b/src/GameController.m @@ -240,8 +240,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. gameSpeed = 1.0; gameLevel = 0; - if ((sender==easyGameButton)||(sender==easyGameMenuItem)) - { + if ((sender == easyGameButton) || + (sender == easyGameMenuItem)) { //NSLog(@"debug - hiScores = %@\n...hiScores.count = %d",hiScores,[hiScores count]); gameLevel = 0; gameTime = 600.0; // ten minutes @@ -249,23 +249,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. localizedStringForKey:@"EasyHighScoresHTML" value:nil table:nil]]; } - if ((sender==hardGameButton)||(sender==hardGameMenuItem)) - { + // TODO: add else if? + if ((sender == hardGameButton) || + (sender == hardGameMenuItem)) { gameLevel = 1; gameTime = 180.0; // three minutes [gameView setHTMLHiScoreLegend:[[NSBundle mainBundle] localizedStringForKey:@"HardHighScoresHTML" value:nil table:nil]]; - } - if ((sender==toughGameButton)||(sender==toughGameMenuItem)) - { + // TODO: add else if? + if ((sender == toughGameButton) || + (sender == toughGameMenuItem)) { gameLevel = 2; gameTime = 90.0; // one and a half minutes [gameView setHTMLHiScoreLegend:[[NSBundle mainBundle] localizedStringForKey:@"ToughHighScoresHTML" value:nil table:nil]]; } + if (sender==freePlayMenuItem) { gameLevel = 3; @@ -275,18 +277,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. localizedStringForKey:@"FreePlayHighScoresHTML" value:nil table:nil]]; } - else + else { freePlay = NO;// FREEPLAY + } + gameNames = [hiScores objectAtIndex:gameLevel*2]; gameScores = [hiScores objectAtIndex:gameLevel*2+1]; [game wholeNewGameWithSpritesFrom:[gameView spriteArray]]; -// [scoreTextField setStringValue:[NSString stringWithFormat:@"%d", game._score]]; [scoreTextField setNeedsDisplay:YES]; [bonusTextField setStringValue:[NSString stringWithFormat:@"x%d", game._bonusMultiplier]]; [bonusTextField setNeedsDisplay:YES]; -// [game setMuted:muted]; [gameView setGame:game]; @@ -321,6 +323,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. abortGame = YES; [self waitForFirstClick]; } + - (IBAction)receiveHiScoreName:(id)sender { int i; -- 2.11.4.GIT