summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xCartographic.xcodeproj/project.pbxproj68
-rwxr-xr-xClasses/CocosOverlayScrollView.h19
-rwxr-xr-xClasses/CocosOverlayScrollView.m106
-rw-r--r--Classes/GameModeSelection.h32
-rw-r--r--Classes/GameModeSelection.m228
-rw-r--r--Classes/GameModeSelectionDelegate.h17
-rw-r--r--Classes/GameModeSelectionLayer.h25
-rw-r--r--Classes/GameModeSelectionLayer.m138
-rwxr-xr-xClasses/MainMenuLayer.h1
-rwxr-xr-xClasses/MainMenuLayer.m17
-rwxr-xr-xClasses/NMPanelMenu.h14
-rwxr-xr-xClasses/NMPanelMenu.m37
-rwxr-xr-xClasses/TouchDelegatingView.h18
-rwxr-xr-xClasses/TouchDelegatingView.m26
-rw-r--r--Classes/TutorialMode.m7
-rw-r--r--Classes/UIImage+ColorMasking.h15
-rw-r--r--Classes/UIImage+ColorMasking.m77
-rwxr-xr-xResources/Info.plist2
-rw-r--r--Resources/florence.pngbin0 -> 24142 bytes
-rw-r--r--Resources/paintdaubs.pngbin0 -> 276898 bytes
-rw-r--r--Resources/paris.pngbin0 -> 24164 bytes
21 files changed, 831 insertions, 16 deletions
diff --git a/Cartographic.xcodeproj/project.pbxproj b/Cartographic.xcodeproj/project.pbxproj index 945a239..8479e51 100755 --- a/Cartographic.xcodeproj/project.pbxproj +++ b/Cartographic.xcodeproj/project.pbxproj
@@ -101,6 +101,10 @@
101 6C0C140E13F1C3EC003A31B2 /* ValuableObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C140D13F1C3EC003A31B2 /* ValuableObject.m */; }; 101 6C0C140E13F1C3EC003A31B2 /* ValuableObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C140D13F1C3EC003A31B2 /* ValuableObject.m */; };
102 6C0C141113F2099B003A31B2 /* Cart.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C141013F2099B003A31B2 /* Cart.m */; }; 102 6C0C141113F2099B003A31B2 /* Cart.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C141013F2099B003A31B2 /* Cart.m */; };
103 6C0C141413F20E98003A31B2 /* GameMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C141313F20E98003A31B2 /* GameMode.m */; }; 103 6C0C141413F20E98003A31B2 /* GameMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C141313F20E98003A31B2 /* GameMode.m */; };
104 6C18C3CA1402AD9C0005AA4C /* UIImage+ColorMasking.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C18C3C91402AD9C0005AA4C /* UIImage+ColorMasking.m */; };
105 6C18C3D214033DC50005AA4C /* CocosOverlayScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C18C3CD14033DC10005AA4C /* CocosOverlayScrollView.m */; };
106 6C18C3D314033DC60005AA4C /* NMPanelMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C18C3CF14033DC30005AA4C /* NMPanelMenu.m */; };
107 6C18C3D414033DC60005AA4C /* TouchDelegatingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C18C3D114033DC40005AA4C /* TouchDelegatingView.m */; };
104 6C19F15B14018EE900F9CCD3 /* libTestFlight.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C19F15A14018EE900F9CCD3 /* libTestFlight.a */; }; 108 6C19F15B14018EE900F9CCD3 /* libTestFlight.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C19F15A14018EE900F9CCD3 /* libTestFlight.a */; };
105 6C19F1631401917500F9CCD3 /* feedback.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C19F1621401917500F9CCD3 /* feedback.png */; }; 109 6C19F1631401917500F9CCD3 /* feedback.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C19F1621401917500F9CCD3 /* feedback.png */; };
106 6C19F1651401917900F9CCD3 /* feedback2.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C19F1641401917900F9CCD3 /* feedback2.png */; }; 110 6C19F1651401917900F9CCD3 /* feedback2.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C19F1641401917900F9CCD3 /* feedback2.png */; };
@@ -108,6 +112,11 @@
108 6C29041213EAEC8A0032DA0F /* framestuff.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C29041113EAEC8A0032DA0F /* framestuff.png */; }; 112 6C29041213EAEC8A0032DA0F /* framestuff.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C29041113EAEC8A0032DA0F /* framestuff.png */; };
109 6C39CFE013FC2708002B21AF /* tutorial.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39CFDF13FC2708002B21AF /* tutorial.png */; }; 113 6C39CFE013FC2708002B21AF /* tutorial.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39CFDF13FC2708002B21AF /* tutorial.png */; };
110 6C39CFE213FC2713002B21AF /* tutorial2.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39CFE113FC2713002B21AF /* tutorial2.png */; }; 114 6C39CFE213FC2713002B21AF /* tutorial2.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39CFE113FC2713002B21AF /* tutorial2.png */; };
115 6C39CFF313FD4F8B002B21AF /* GameModeSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C39CFF213FD4F89002B21AF /* GameModeSelection.m */; };
116 6C39CFF513FD5526002B21AF /* paintdaubs.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39CFF413FD5526002B21AF /* paintdaubs.png */; };
117 6C39CFF813FD7638002B21AF /* GameModeSelectionLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C39CFF713FD7637002B21AF /* GameModeSelectionLayer.m */; };
118 6C39D00813FD9037002B21AF /* florence.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39D00713FD9037002B21AF /* florence.png */; };
119 6C39D01213FD9945002B21AF /* paris.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C39D01113FD9945002B21AF /* paris.png */; };
111 6C5179C613DF3839006F1F38 /* Morning1.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C5179C513DF3839006F1F38 /* Morning1.png */; }; 120 6C5179C613DF3839006F1F38 /* Morning1.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C5179C513DF3839006F1F38 /* Morning1.png */; };
112 6CC89DD913F2F4E6003704F7 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6CC89DD813F2F4E6003704F7 /* Entitlements.plist */; }; 121 6CC89DD913F2F4E6003704F7 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6CC89DD813F2F4E6003704F7 /* Entitlements.plist */; };
113 6CC89DDF13F31413003704F7 /* TutorialMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CC89DDE13F31413003704F7 /* TutorialMode.m */; }; 122 6CC89DDF13F31413003704F7 /* TutorialMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CC89DDE13F31413003704F7 /* TutorialMode.m */; };
@@ -409,6 +418,14 @@
409 6C0C141013F2099B003A31B2 /* Cart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cart.m; sourceTree = "<group>"; }; 418 6C0C141013F2099B003A31B2 /* Cart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cart.m; sourceTree = "<group>"; };
410 6C0C141213F20E98003A31B2 /* GameMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameMode.h; sourceTree = "<group>"; }; 419 6C0C141213F20E98003A31B2 /* GameMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameMode.h; sourceTree = "<group>"; };
411 6C0C141313F20E98003A31B2 /* GameMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameMode.m; sourceTree = "<group>"; }; 420 6C0C141313F20E98003A31B2 /* GameMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameMode.m; sourceTree = "<group>"; };
421 6C18C3C81402AD9C0005AA4C /* UIImage+ColorMasking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ColorMasking.h"; sourceTree = "<group>"; };
422 6C18C3C91402AD9C0005AA4C /* UIImage+ColorMasking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ColorMasking.m"; sourceTree = "<group>"; };
423 6C18C3CC14033DBF0005AA4C /* CocosOverlayScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosOverlayScrollView.h; sourceTree = "<group>"; };
424 6C18C3CD14033DC10005AA4C /* CocosOverlayScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosOverlayScrollView.m; sourceTree = "<group>"; };
425 6C18C3CE14033DC20005AA4C /* NMPanelMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NMPanelMenu.h; sourceTree = "<group>"; };
426 6C18C3CF14033DC30005AA4C /* NMPanelMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NMPanelMenu.m; sourceTree = "<group>"; };
427 6C18C3D014033DC40005AA4C /* TouchDelegatingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchDelegatingView.h; sourceTree = "<group>"; };
428 6C18C3D114033DC40005AA4C /* TouchDelegatingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TouchDelegatingView.m; sourceTree = "<group>"; };
412 6C19F15A14018EE900F9CCD3 /* libTestFlight.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libTestFlight.a; sourceTree = "<group>"; }; 429 6C19F15A14018EE900F9CCD3 /* libTestFlight.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libTestFlight.a; sourceTree = "<group>"; };
413 6C19F15D14018FDF00F9CCD3 /* TestFlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestFlight.h; sourceTree = "<group>"; }; 430 6C19F15D14018FDF00F9CCD3 /* TestFlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestFlight.h; sourceTree = "<group>"; };
414 6C19F1621401917500F9CCD3 /* feedback.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = feedback.png; sourceTree = "<group>"; }; 431 6C19F1621401917500F9CCD3 /* feedback.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = feedback.png; sourceTree = "<group>"; };
@@ -418,7 +435,15 @@
418 6C29041113EAEC8A0032DA0F /* framestuff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = framestuff.png; sourceTree = "<group>"; }; 435 6C29041113EAEC8A0032DA0F /* framestuff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = framestuff.png; sourceTree = "<group>"; };
419 6C39CFDF13FC2708002B21AF /* tutorial.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tutorial.png; sourceTree = "<group>"; }; 436 6C39CFDF13FC2708002B21AF /* tutorial.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tutorial.png; sourceTree = "<group>"; };
420 6C39CFE113FC2713002B21AF /* tutorial2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tutorial2.png; sourceTree = "<group>"; }; 437 6C39CFE113FC2713002B21AF /* tutorial2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tutorial2.png; sourceTree = "<group>"; };
438 6C39CFF113FD4F87002B21AF /* GameModeSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameModeSelection.h; sourceTree = "<group>"; };
439 6C39CFF213FD4F89002B21AF /* GameModeSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameModeSelection.m; sourceTree = "<group>"; };
440 6C39CFF413FD5526002B21AF /* paintdaubs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = paintdaubs.png; sourceTree = "<group>"; };
441 6C39CFF613FD7636002B21AF /* GameModeSelectionLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameModeSelectionLayer.h; sourceTree = "<group>"; };
442 6C39CFF713FD7637002B21AF /* GameModeSelectionLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameModeSelectionLayer.m; sourceTree = "<group>"; };
443 6C39D00713FD9037002B21AF /* florence.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = florence.png; sourceTree = "<group>"; };
444 6C39D01113FD9945002B21AF /* paris.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = paris.png; sourceTree = "<group>"; };
421 6C5179C513DF3839006F1F38 /* Morning1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Morning1.png; sourceTree = "<group>"; }; 445 6C5179C513DF3839006F1F38 /* Morning1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Morning1.png; sourceTree = "<group>"; };
446 6CB532581403BA4F00780A5E /* GameModeSelectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameModeSelectionDelegate.h; sourceTree = "<group>"; };
422 6CC89DD813F2F4E6003704F7 /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Entitlements.plist; sourceTree = "<group>"; }; 447 6CC89DD813F2F4E6003704F7 /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Entitlements.plist; sourceTree = "<group>"; };
423 6CC89DDD13F31413003704F7 /* TutorialMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TutorialMode.h; sourceTree = "<group>"; }; 448 6CC89DDD13F31413003704F7 /* TutorialMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TutorialMode.h; sourceTree = "<group>"; };
424 6CC89DDE13F31413003704F7 /* TutorialMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TutorialMode.m; sourceTree = "<group>"; }; 449 6CC89DDE13F31413003704F7 /* TutorialMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TutorialMode.m; sourceTree = "<group>"; };
@@ -704,6 +729,7 @@
704 2D500B1D0D5A766B00DBA0E3 /* Classes */ = { 729 2D500B1D0D5A766B00DBA0E3 /* Classes */ = {
705 isa = PBXGroup; 730 isa = PBXGroup;
706 children = ( 731 children = (
732 6CB532561403492E00780A5E /* Selection Screen */,
707 6C0C141513F211C7003A31B2 /* Game Modes */, 733 6C0C141513F211C7003A31B2 /* Game Modes */,
708 6C5887E313EE3ED900B5A80A /* Items */, 734 6C5887E313EE3ED900B5A80A /* Items */,
709 E0F81035120A173C005866B8 /* GameConfig.h */, 735 E0F81035120A173C005866B8 /* GameConfig.h */,
@@ -728,6 +754,7 @@
728 3F6C7F4C13D647AF00C038FE /* Backgrounds */ = { 754 3F6C7F4C13D647AF00C038FE /* Backgrounds */ = {
729 isa = PBXGroup; 755 isa = PBXGroup;
730 children = ( 756 children = (
757 6C39CFF413FD5526002B21AF /* paintdaubs.png */,
731 6C5179C513DF3839006F1F38 /* Morning1.png */, 758 6C5179C513DF3839006F1F38 /* Morning1.png */,
732 3F6C7F4A13D647A600C038FE /* GameOver.png */, 759 3F6C7F4A13D647A600C038FE /* GameOver.png */,
733 3F6C7F2313D63E6500C038FE /* SeaBeach.png */, 760 3F6C7F2313D63E6500C038FE /* SeaBeach.png */,
@@ -856,6 +883,7 @@
856 50F4144210692EE7002A0D5E /* Resources */ = { 883 50F4144210692EE7002A0D5E /* Resources */ = {
857 isa = PBXGroup; 884 isa = PBXGroup;
858 children = ( 885 children = (
886 6C39D00513FD901A002B21AF /* Icons */,
859 3F7D0EC713D8E6B000B6CE14 /* Buttons */, 887 3F7D0EC713D8E6B000B6CE14 /* Buttons */,
860 3F8395B713D744420059AEE8 /* cartdata.sqlite3 */, 888 3F8395B713D744420059AEE8 /* cartdata.sqlite3 */,
861 3F6C7F5D13D648D300C038FE /* Fonts */, 889 3F6C7F5D13D648D300C038FE /* Fonts */,
@@ -887,6 +915,15 @@
887 name = "Game Modes"; 915 name = "Game Modes";
888 sourceTree = "<group>"; 916 sourceTree = "<group>";
889 }; 917 };
918 6C39D00513FD901A002B21AF /* Icons */ = {
919 isa = PBXGroup;
920 children = (
921 6C39D01113FD9945002B21AF /* paris.png */,
922 6C39D00713FD9037002B21AF /* florence.png */,
923 );
924 name = Icons;
925 sourceTree = "<group>";
926 };
890 6C5887E313EE3ED900B5A80A /* Items */ = { 927 6C5887E313EE3ED900B5A80A /* Items */ = {
891 isa = PBXGroup; 928 isa = PBXGroup;
892 children = ( 929 children = (
@@ -909,6 +946,26 @@
909 name = Items; 946 name = Items;
910 sourceTree = "<group>"; 947 sourceTree = "<group>";
911 }; 948 };
949 6CB532561403492E00780A5E /* Selection Screen */ = {
950 isa = PBXGroup;
951 children = (
952 6C39CFF113FD4F87002B21AF /* GameModeSelection.h */,
953 6C39CFF213FD4F89002B21AF /* GameModeSelection.m */,
954 6C39CFF613FD7636002B21AF /* GameModeSelectionLayer.h */,
955 6C39CFF713FD7637002B21AF /* GameModeSelectionLayer.m */,
956 6C18C3C81402AD9C0005AA4C /* UIImage+ColorMasking.h */,
957 6C18C3C91402AD9C0005AA4C /* UIImage+ColorMasking.m */,
958 6C18C3CC14033DBF0005AA4C /* CocosOverlayScrollView.h */,
959 6C18C3CD14033DC10005AA4C /* CocosOverlayScrollView.m */,
960 6C18C3CE14033DC20005AA4C /* NMPanelMenu.h */,
961 6C18C3CF14033DC30005AA4C /* NMPanelMenu.m */,
962 6C18C3D014033DC40005AA4C /* TouchDelegatingView.h */,
963 6C18C3D114033DC40005AA4C /* TouchDelegatingView.m */,
964 6CB532581403BA4F00780A5E /* GameModeSelectionDelegate.h */,
965 );
966 name = "Selection Screen";
967 sourceTree = "<group>";
968 };
912 E02BBB19126CC2F5006E46A2 /* cocos2d */ = { 969 E02BBB19126CC2F5006E46A2 /* cocos2d */ = {
913 isa = PBXGroup; 970 isa = PBXGroup;
914 children = ( 971 children = (
@@ -1375,6 +1432,9 @@
1375 6CC89DD913F2F4E6003704F7 /* Entitlements.plist in Resources */, 1432 6CC89DD913F2F4E6003704F7 /* Entitlements.plist in Resources */,
1376 6C39CFE013FC2708002B21AF /* tutorial.png in Resources */, 1433 6C39CFE013FC2708002B21AF /* tutorial.png in Resources */,
1377 6C39CFE213FC2713002B21AF /* tutorial2.png in Resources */, 1434 6C39CFE213FC2713002B21AF /* tutorial2.png in Resources */,
1435 6C39CFF513FD5526002B21AF /* paintdaubs.png in Resources */,
1436 6C39D00813FD9037002B21AF /* florence.png in Resources */,
1437 6C39D01213FD9945002B21AF /* paris.png in Resources */,
1378 6C19F1631401917500F9CCD3 /* feedback.png in Resources */, 1438 6C19F1631401917500F9CCD3 /* feedback.png in Resources */,
1379 6C19F1651401917900F9CCD3 /* feedback2.png in Resources */, 1439 6C19F1651401917900F9CCD3 /* feedback2.png in Resources */,
1380 ); 1440 );
@@ -1421,6 +1481,12 @@
1421 6C0C141113F2099B003A31B2 /* Cart.m in Sources */, 1481 6C0C141113F2099B003A31B2 /* Cart.m in Sources */,
1422 6C0C141413F20E98003A31B2 /* GameMode.m in Sources */, 1482 6C0C141413F20E98003A31B2 /* GameMode.m in Sources */,
1423 6CC89DDF13F31413003704F7 /* TutorialMode.m in Sources */, 1483 6CC89DDF13F31413003704F7 /* TutorialMode.m in Sources */,
1484 6C39CFF313FD4F8B002B21AF /* GameModeSelection.m in Sources */,
1485 6C39CFF813FD7638002B21AF /* GameModeSelectionLayer.m in Sources */,
1486 6C18C3CA1402AD9C0005AA4C /* UIImage+ColorMasking.m in Sources */,
1487 6C18C3D214033DC50005AA4C /* CocosOverlayScrollView.m in Sources */,
1488 6C18C3D314033DC60005AA4C /* NMPanelMenu.m in Sources */,
1489 6C18C3D414033DC60005AA4C /* TouchDelegatingView.m in Sources */,
1424 ); 1490 );
1425 runOnlyForDeploymentPostprocessing = 0; 1491 runOnlyForDeploymentPostprocessing = 0;
1426 }; 1492 };
@@ -1549,6 +1615,7 @@
1549 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1615 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1550 COPY_PHASE_STRIP = NO; 1616 COPY_PHASE_STRIP = NO;
1551 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1617 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1618 GCC_C_LANGUAGE_STANDARD = c99;
1552 GCC_DYNAMIC_NO_PIC = NO; 1619 GCC_DYNAMIC_NO_PIC = NO;
1553 GCC_OPTIMIZATION_LEVEL = 0; 1620 GCC_OPTIMIZATION_LEVEL = 0;
1554 GCC_PRECOMPILE_PREFIX_HEADER = YES; 1621 GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1581,6 +1648,7 @@
1581 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1648 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1582 COPY_PHASE_STRIP = YES; 1649 COPY_PHASE_STRIP = YES;
1583 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1650 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1651 GCC_C_LANGUAGE_STANDARD = c99;
1584 GCC_PRECOMPILE_PREFIX_HEADER = YES; 1652 GCC_PRECOMPILE_PREFIX_HEADER = YES;
1585 GCC_PREFIX_HEADER = Cart_Collect_Prefix.pch; 1653 GCC_PREFIX_HEADER = Cart_Collect_Prefix.pch;
1586 GCC_TREAT_WARNINGS_AS_ERRORS = NO; 1654 GCC_TREAT_WARNINGS_AS_ERRORS = NO;
diff --git a/Classes/CocosOverlayScrollView.h b/Classes/CocosOverlayScrollView.h new file mode 100755 index 0000000..ad8e83f --- /dev/null +++ b/Classes/CocosOverlayScrollView.h
@@ -0,0 +1,19 @@
1//
2// CocosOverlayScrollView.h
3// shapes
4//
5// Created by Nate Murray on 8/23/10.
6// Copyright 2010 LittleHiccup. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "cocos2d.h"
11
12@interface CocosOverlayScrollView : UIScrollView <UIScrollViewDelegate>
13{
14 CCNode* targetLayer;
15 UIPageControl* pageControl;
16}
17@property(nonatomic, retain) CCNode* targetLayer;
18-(id) initWithFrame: (CGRect) frameRect numPages: (int) numPages width: (float) width layer: (CCNode*) layer pageControl:(UIPageControl*)pageControl;
19@end
diff --git a/Classes/CocosOverlayScrollView.m b/Classes/CocosOverlayScrollView.m new file mode 100755 index 0000000..dee9dfe --- /dev/null +++ b/Classes/CocosOverlayScrollView.m
@@ -0,0 +1,106 @@
1//
2// CocosOverlayScrollView.m
3// shapes
4//
5// Created by Nate Murray on 8/23/10.
6// Copyright 2010 LittleHiccup. All rights reserved.
7//
8
9#import "CocosOverlayScrollView.h"
10
11@implementation CocosOverlayScrollView
12@synthesize targetLayer;
13
14// Configure your favorite UIScrollView options here
15-(id) initWithFrame: (CGRect) frameRect numPages: (int) numPages width: (float) width layer: (CCNode*) layer pageControl:(UIPageControl *)m_pageControl{
16 if ((self = [super initWithFrame: frameRect])){
17 self.contentSize = CGSizeMake(width*numPages, 320);
18 self.bounces = YES;
19 self.delaysContentTouches = NO;
20 self.delegate = self;
21 self.pagingEnabled = YES;
22 self.scrollsToTop = NO;
23 self.showsVerticalScrollIndicator = NO;
24 self.showsHorizontalScrollIndicator = NO;
25 [self setUserInteractionEnabled:TRUE];
26 [self setScrollEnabled:TRUE];
27 self.targetLayer = layer;
28 // self.canCancelContentTouches = YES;
29 pageControl = m_pageControl;
30 }
31 return self;
32}
33
34-(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
35{
36 if (!self.dragging)
37 {
38 // UITouch* touch = [[touches allObjects] objectAtIndex:0];
39 // CGPoint location = [touch locationInView: [[touch view] superview]];
40 // CCLOG(@"touch at l.x:%f l.y:%f", location.x, location.y);
41
42 [self.nextResponder touchesBegan: touches withEvent:event];
43 [[[CCDirector sharedDirector] openGLView] touchesBegan:touches withEvent:event];
44 }
45
46 [super touchesBegan: touches withEvent: event];
47}
48
49-(void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event
50{
51 if (!self.dragging)
52 {
53 [self.nextResponder touchesEnded: touches withEvent:event];
54 [[[CCDirector sharedDirector] openGLView] touchesEnded:touches withEvent:event];
55 }
56
57 [super touchesEnded: touches withEvent: event];
58}
59
60-(void) touchesCancelled: (NSSet *) touches withEvent: (UIEvent *) event
61{
62 // if (!self.dragging)
63 // {
64 // CCLOG(@"CocosOverlayScrollView touchesEnded not dragging");
65 [self.nextResponder touchesCancelled: touches withEvent:event];
66 [[[CCDirector sharedDirector] openGLView] touchesCancelled:touches withEvent:event];
67 // }
68 [super touchesCancelled: touches withEvent: event];
69}
70
71
72- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView
73{
74 // TODO - Custom code for handling deceleration of the scroll view
75}
76
77- (void)scrollViewDidScroll:(UIScrollView *)scrollView
78{
79 CGPoint dragPt = [scrollView contentOffset];
80 dragPt = [[CCDirector sharedDirector] convertToGL:dragPt];
81
82 dragPt.y = dragPt.y * -1;
83 dragPt.x = dragPt.x * -1;
84
85 CGPoint newLayerPosition = CGPointMake(dragPt.x, dragPt.y);
86
87 [targetLayer setPosition:newLayerPosition];
88}
89
90- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
91{
92 // CGPoint dragPt = [scrollView contentOffset];
93 // etc.
94}
95
96-(void) dealloc {
97 self.targetLayer = nil;
98 [super dealloc];
99}
100
101- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
102{
103 [pageControl setCurrentPage:(NSUInteger)([scrollView contentOffset].x / [scrollView frame].size.width)];
104}
105
106@end \ No newline at end of file
diff --git a/Classes/GameModeSelection.h b/Classes/GameModeSelection.h new file mode 100644 index 0000000..f69ea37 --- /dev/null +++ b/Classes/GameModeSelection.h
@@ -0,0 +1,32 @@
1//
2// GameModeSelection.h
3// Cartographic
4//
5// Created by Starla Insigna on 8/18/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import "cocos2d.h"
10#import "GameModeSelectionDelegate.h"
11
12@interface GameModeSelection : CCMenuItem {
13 NSString* name;
14 NSString* location;
15 BOOL unlocked;
16 NSString* unlockCondition;
17 id<GameModeSelectionDelegate> delegate;
18}
19
20@property (readonly) NSString* name;
21@property (readonly) NSString* location;
22@property (readonly) BOOL unlocked;
23@property (nonatomic,retain) id<GameModeSelectionDelegate> delegate;
24+ (id)selectionWithName:(NSString*)name location:(NSString*)location filename:(NSString*)filename unlocked:(BOOL)unlocked;
25+ (id)selectionWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename highscore:(int)highscore;
26+ (id)selectionWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename unlockCondition:(NSString*)unlockCondition;
27- (id)initWithName:(NSString*)name location:(NSString*)location filename:(NSString*)filename unlocked:(BOOL)unlocked;
28- (id)initWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename highscore:(int)highscore;
29- (id)initWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename unlockCondition:(NSString*)unlockCondition;
30- (void)buttonTapped;
31
32@end
diff --git a/Classes/GameModeSelection.m b/Classes/GameModeSelection.m new file mode 100644 index 0000000..582c9dd --- /dev/null +++ b/Classes/GameModeSelection.m
@@ -0,0 +1,228 @@
1//
2// GameModeSelection.m
3// Cartographic
4//
5// Created by Starla Insigna on 8/18/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import "GameModeSelection.h"
10#import "UIImage+ColorMasking.h"
11#import "NMPanelMenu.h"
12
13@implementation GameModeSelection
14
15@synthesize name, location, unlocked, delegate;
16
17+ (id)selectionWithName:(NSString*)name location:(NSString*)location filename:(NSString*)filename unlocked:(BOOL)unlocked
18{
19 return [[[GameModeSelection alloc] initWithName:name location:location filename:filename unlocked:unlocked] autorelease];
20}
21
22+ (id)selectionWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename highscore:(int)highscore
23{
24 return [[[GameModeSelection alloc] initWithName:name location:location filename:filename highscore:highscore] autorelease];
25}
26
27+ (id)selectionWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename unlockCondition:(NSString*)unlockCondition
28{
29 return [[[GameModeSelection alloc] initWithName:name location:location filename:filename unlockCondition:unlockCondition] autorelease];
30}
31
32- (id)initWithName:(NSString*)m_name location:(NSString*)m_location filename:(NSString*)filename unlocked:(BOOL)m_unlocked;
33{
34 self = [super initWithTarget:nil selector:nil];
35
36 if (nil != self)
37 {
38 self.anchorPoint = CGPointMake(0.5f, 0.5f);
39
40 name = m_name;
41 location = m_location;
42 unlocked = m_unlocked;
43
44 contentSize_ = CGSizeMake(128, 320);
45
46 NSString* filenameMod;
47
48 if (unlocked)
49 {
50 filenameMod = [NSString stringWithFormat:@"%@-unlocked", filename];
51 } else {
52 filenameMod = [NSString stringWithFormat:@"%@-locked", filename];
53 name = [@"" stringByPaddingToLength:name.length withString:@"?" startingAtIndex:0];
54 location = [@"" stringByPaddingToLength:location.length withString:@"?" startingAtIndex:0];
55 }
56
57 // First, create the frame that we will put the level picture inside
58 CGImageRef framestuff = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"framestuff" ofType:@"png"]] CGImage];
59 CGImageRef topLeftRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(0, 0, 8, 8));
60 CGImageRef topRightRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(8, 0, 8, 8));
61 CGImageRef bottomLeftRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(0, 8, 8, 8));
62 CGImageRef bottomRightRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(8, 8, 8, 8));
63 CGImageRef topBorderRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(0, 16, 8, 8));
64 CGImageRef leftBorderRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(8, 16, 8, 8));
65 CGImageRef rightBorderRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(0, 24, 8, 8));
66 CGImageRef bottomBorderRef = CGImageCreateWithImageInRect(framestuff, CGRectMake(8, 24, 8, 8));
67 UIImage* topLeft = [UIImage imageWithCGImage:topLeftRef];
68 UIImage* topRight = [UIImage imageWithCGImage:topRightRef];
69 UIImage* bottomLeft = [UIImage imageWithCGImage:bottomLeftRef];
70 UIImage* bottomRight = [UIImage imageWithCGImage:bottomRightRef];
71 UIImage* topBorder = [UIImage imageWithCGImage:topBorderRef];
72 UIImage* leftBorder = [UIImage imageWithCGImage:leftBorderRef];
73 UIImage* rightBorder = [UIImage imageWithCGImage:rightBorderRef];
74 UIImage* bottomBorder = [UIImage imageWithCGImage:bottomBorderRef];
75 CGImageRelease(topLeftRef);
76 CGImageRelease(topRightRef);
77 CGImageRelease(bottomLeftRef);
78 CGImageRelease(bottomRightRef);
79 CGImageRelease(topBorderRef);
80 CGImageRelease(leftBorderRef);
81 CGImageRelease(rightBorderRef);
82 CGImageRelease(bottomBorderRef);
83
84 CGSize boxSize = CGSizeMake(128+12, 128+12);
85 UIGraphicsBeginImageContext(boxSize);
86 CGContextRef context = UIGraphicsGetCurrentContext();
87 [topLeft drawInRect:CGRectMake(0, 0, 8, 8)];
88 [topBorder drawInRect:CGRectMake(8, 0, boxSize.width-16, 8)];
89 [topRight drawInRect:CGRectMake(8+boxSize.width-16, 0, 8, 8)];
90 [rightBorder drawInRect:CGRectMake(8+boxSize.width-16, 8, 8, boxSize.height-16)];
91 [bottomRight drawInRect:CGRectMake(8+boxSize.width-16, 8+boxSize.height-16, 8, 8)];
92 [bottomBorder drawInRect:CGRectMake(8, 8+boxSize.height-16, boxSize.width-16, 8)];
93 [bottomLeft drawInRect:CGRectMake(0, 8+boxSize.height-16, 8, 8)];
94 [leftBorder drawInRect:CGRectMake(0, 8, 8, boxSize.height-16)];
95 CGContextSetFillColorWithColor(context, [[UIColor whiteColor] CGColor]);
96 CGContextFillRect(context, CGRectMake(8, 8, boxSize.width-16, boxSize.height-16));
97 UIImage* selectionBackground = UIGraphicsGetImageFromCurrentImageContext();
98
99 // Now we want to put the level image inside the frame without messing up the frame itself
100 UIImage* innerPicture = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename ofType:@"png"]];
101 CGContextClipToMask(context, CGRectMake(0, 0, boxSize.width, boxSize.height), [[selectionBackground opaqueMaskFromWhiteImage] CGImage]);
102 [innerPicture drawInRect:CGRectMake(6, 6, 128, 128)];
103 selectionBackground = UIGraphicsGetImageFromCurrentImageContext();
104 UIGraphicsEndImageContext();
105
106 // The frame needs a shadow, so let's redraw it in a new context
107 UIGraphicsBeginImageContext(CGSizeMake(boxSize.width+10, boxSize.height+10));
108 context = UIGraphicsGetCurrentContext();
109 CGContextSaveGState(context);
110
111 if (unlocked)
112 {
113 CGContextSetShadow(context, CGSizeMake(-6, 6), 4.0f);
114 [selectionBackground drawInRect:CGRectMake(10, 0, boxSize.width, boxSize.height)];
115 } else {
116 // Draw the picture in grayscale if the level has not yet been unlocked
117 CGContextClipToMask(context, CGRectMake(10, 0, boxSize.width, boxSize.height), [selectionBackground CGImage]);
118 CGContextSetFillColorWithColor(context, [[UIColor whiteColor] CGColor]);
119 CGContextFillRect(context, CGRectMake(10, 0, boxSize.width, boxSize.height));
120 CGContextRestoreGState(context);
121
122 CGContextSaveGState(context);
123 CGContextSetShadow(context, CGSizeMake(-6, 6), 4.0f);
124 [selectionBackground drawInRect:CGRectMake(10, 0, boxSize.width, boxSize.height) blendMode:kCGBlendModeLuminosity alpha:1.0];
125 }
126
127 CGContextRestoreGState(context);
128 CGImageRef pictureRef = [UIGraphicsGetImageFromCurrentImageContext() CGImage];
129
130 CCSprite* picture = [CCSprite spriteWithCGImage:pictureRef key:[NSString stringWithFormat:@"gms-%@", filenameMod]];
131
132 // We're also going to need a "selected" image state for the button
133 CGContextSaveGState(context);
134 CGContextClipToMask(context, CGRectMake(10, 0, boxSize.width, boxSize.height), [selectionBackground CGImage]);
135 CGContextSetFillColorWithColor(context, [[UIColor colorWithRed:0 green:0 blue:0 alpha:0.5] CGColor]);
136 CGContextFillRect(context, CGRectMake(10, 0, boxSize.width, boxSize.height));
137 CGContextRestoreGState(context);
138 CGImageRef selectedButtonRef = [UIGraphicsGetImageFromCurrentImageContext() CGImage];
139 UIGraphicsEndImageContext();
140 CCSprite* selectedButton = [CCSprite spriteWithCGImage:selectedButtonRef key:[NSString stringWithFormat:@"gms-%@-selected", filenameMod]];
141
142 CCMenuItemSprite* pictureMenuItem = [CCMenuItemSprite itemFromNormalSprite:picture selectedSprite:selectedButton target:self selector:@selector(buttonTapped)];
143 NMPanelMenu* theMenu = [NMPanelMenu menuWithItems:pictureMenuItem, nil];
144 theMenu.position = ccp(-5, 0);
145 [self addChild:theMenu];
146
147 // Render the titles
148 UIFont* titleFont = [UIFont fontWithName:@"AmericanTypewriter-Bold" size:18.0f];
149 CGSize titleSize = [location sizeWithFont:titleFont constrainedToSize:CGSizeMake(128, 0)];
150 UIFont* subtitleFont = [UIFont fontWithName:@"AmericanTypewriter" size:18.0f];
151 CGSize subtitleSize = [name sizeWithFont:subtitleFont constrainedToSize:CGSizeMake(128, 0)];
152 CGSize combinedTitleSize = CGSizeMake(128, titleSize.height + 10 + subtitleSize.height + 10);
153
154 UIGraphicsBeginImageContext(combinedTitleSize);
155 context = UIGraphicsGetCurrentContext();
156 CGContextSetShadow(context, CGSizeMake(-6, 6), 4.0f);
157 [location drawInRect:CGRectMake(10, 0, 128, titleSize.height) withFont:titleFont lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
158 [name drawInRect:CGRectMake(10, titleSize.height, 128, subtitleSize.height) withFont:subtitleFont lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
159
160 CGImageRef titleImage = [UIGraphicsGetImageFromCurrentImageContext() CGImage];
161 UIGraphicsEndImageContext();
162 CCSprite* titleSprite = [CCSprite spriteWithCGImage:titleImage key:[NSString stringWithFormat:@"gms-%@-title", filenameMod]];
163 titleSprite.position = ccp(-10, (boxSize.height)/2+(combinedTitleSize.height)/2);
164 [self addChild:titleSprite];
165 }
166
167 return self;
168}
169
170- (id)initWithName:(NSString *)m_name location:(NSString *)m_location filename:(NSString *)m_filename highscore:(int)m_highscore
171{
172 self = [self initWithName:m_name location:m_location filename:m_filename unlocked:YES];
173
174 if (nil != self)
175 {
176 if (m_highscore != 0)
177 {
178 // Render the highscore label
179 NSString* highscoreString = [NSString stringWithFormat:@"Highscore: %d", m_highscore];
180 UIFont* highscoreFont = [UIFont fontWithName:@"AmericanTypewriter" size:16.0f];
181 CGSize highscoreSize = [highscoreString sizeWithFont:highscoreFont];
182
183 UIGraphicsBeginImageContext(CGSizeMake(highscoreSize.width+10, highscoreSize.height+10));
184 CGContextRef context = UIGraphicsGetCurrentContext();
185 CGContextSetShadow(context, CGSizeMake(-6, 6), 4.0f);
186 [highscoreString drawInRect:CGRectMake(10, 0, highscoreSize.width, highscoreSize.height) withFont:highscoreFont];
187
188 CGImageRef highscoreImage = [UIGraphicsGetImageFromCurrentImageContext() CGImage];
189 UIGraphicsEndImageContext();
190 CCSprite* highscoreSprite = [CCSprite spriteWithCGImage:highscoreImage key:[NSString stringWithFormat:@"gms-%@-highscore", m_filename]];
191 highscoreSprite.position = ccp((128-highscoreSize.width)/2, 0-64-(highscoreSize.height)/2-10);
192 [self addChild:highscoreSprite];
193 }
194 }
195
196 return self;
197}
198
199- (id)initWithName:(NSString *)m_name location:(NSString *)m_location filename:(NSString *)m_filename unlockCondition:(NSString*)m_unlockCondition
200{
201 self = [self initWithName:m_name location:m_location filename:m_filename unlocked:NO];
202
203 if (nil != self)
204 {
205 unlockCondition = m_unlockCondition;
206 }
207
208 return self;
209}
210
211- (void)buttonTapped
212{
213 if (unlocked)
214 {
215 if (delegate != nil)
216 {
217 [delegate didSelectGameMode:self];
218 } else {
219 NSLog(@"I don't have a GameModeSelectionDelegate to call for some reason...");
220 }
221 } else {
222 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"To unlock this game mode:" message:unlockCondition delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:nil];
223 [alertView show];
224 [alertView release];
225 }
226}
227
228@end
diff --git a/Classes/GameModeSelectionDelegate.h b/Classes/GameModeSelectionDelegate.h new file mode 100644 index 0000000..854a980 --- /dev/null +++ b/Classes/GameModeSelectionDelegate.h
@@ -0,0 +1,17 @@
1//
2// GameModeSelectionDelegate.h
3// Cartographic
4//
5// Created by Starla Insigna on 8/23/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@class GameModeSelection;
12
13@protocol GameModeSelectionDelegate <NSObject>
14
15- (void)didSelectGameMode:(GameModeSelection*)gameMode;
16
17@end
diff --git a/Classes/GameModeSelectionLayer.h b/Classes/GameModeSelectionLayer.h new file mode 100644 index 0000000..478a173 --- /dev/null +++ b/Classes/GameModeSelectionLayer.h
@@ -0,0 +1,25 @@
1//
2// GameModeSelectionLayer.h
3// Cartographic
4//
5// Created by Starla Insigna on 8/18/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import "cocos2d.h"
10#import "TouchDelegatingView.h"
11#import "CocosOverlayScrollView.h"
12#import "GameModeSelectionDelegate.h"
13
14@interface GameModeSelectionLayer : CCLayer <GameModeSelectionDelegate> {
15 NSMutableArray* gameModes;
16 TouchDelegatingView* touchDelegatingView;
17 CocosOverlayScrollView* scrollView;
18 UIPageControl* pageControl;
19}
20
21+ (CCScene*)scene;
22- (id)init;
23- (void)mainmenu;
24
25@end
diff --git a/Classes/GameModeSelectionLayer.m b/Classes/GameModeSelectionLayer.m new file mode 100644 index 0000000..ad6a455 --- /dev/null +++ b/Classes/GameModeSelectionLayer.m
@@ -0,0 +1,138 @@
1//
2// GameModeSelectionLayer.m
3// Cartographic
4//
5// Created by Starla Insigna on 8/18/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import "GameModeSelectionLayer.h"
10#import "GameModeSelection.h"
11#import <sqlite3.h>
12#import "Cart_CollectAppDelegate.h"
13#import "MainMenuLayer.h"
14#import "TutorialMode.h"
15#import "ClassicGameMode.h"
16
17@implementation GameModeSelectionLayer
18
19+ (CCScene*)scene
20{
21 CCScene* scene = [CCScene node];
22
23 CCLayer* backgroundLayer = [[[CCLayer alloc] init] autorelease];
24 CCSprite* backgroundImage = [CCSprite spriteWithFile:@"paintdaubs.png"];
25 backgroundImage.position = ccp(240,160);
26 [backgroundLayer addChild:backgroundImage];
27 [scene addChild:backgroundLayer];
28
29 GameModeSelectionLayer* layer = [GameModeSelectionLayer node];
30 [scene addChild:layer];
31
32 return scene;
33}
34
35- (id)init
36{
37 self = [super init];
38
39 if (nil != self)
40 {
41 gameModes = [[NSMutableArray alloc] init];
42 CCMenu* menu = [CCMenu menuWithItems:nil];
43 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
44 float onePanelWide = 128;
45
46 GameModeSelection* tutorialSelection = [GameModeSelection selectionWithName:@"Tutorial" location:@"Florence" filename:@"florence" unlocked:YES];
47 [gameModes addObject:tutorialSelection];
48
49 GameModeSelection* collectSelection;
50
51 if ([defaults boolForKey:@"hasDoneTutorial"])
52 {
53 const char* sqlQuery = "SELECT * FROM highscores ORDER BY score DESC LIMIT 1";
54 sqlite3_stmt* compiled_statement;
55 int score = 0;
56
57 if (sqlite3_prepare_v2([Cart_CollectAppDelegate database], sqlQuery, -1, &compiled_statement, NULL) == SQLITE_OK)
58 {
59 if (sqlite3_step(compiled_statement) == SQLITE_ROW)
60 {
61 score = sqlite3_column_int(compiled_statement, 2);
62 }
63 }
64
65 collectSelection = [GameModeSelection selectionWithName:@"Collect" location:@"Paris" filename:@"paris" highscore:score];
66 } else {
67 collectSelection = [GameModeSelection selectionWithName:@"Collect" location:@"Paris" filename:@"paris" unlockCondition:@"Beat the tutorial!"];
68 }
69
70 [gameModes addObject:collectSelection];
71
72 float padding = 15;
73 float totalPanelWidth = onePanelWide + padding*2;
74 float numberOfPanels = [gameModes count];
75 float totalWidth = numberOfPanels * totalPanelWidth;
76 int currentWorldOffset = [defaults integerForKey:@"lastSelectedMode"];
77 CCLayer* panels = [CCLayer node];
78
79 for (GameModeSelection* gameMode in gameModes)
80 {
81 [gameMode setDelegate:self];
82 [menu addChild:gameMode];
83 }
84
85 [menu alignItemsHorizontallyWithPadding:padding*2];
86 [panels addChild:menu];
87 [self addChild:panels];
88
89 pageControl = [[UIPageControl alloc] init];
90 pageControl.numberOfPages = numberOfPanels;
91 pageControl.currentPage = currentWorldOffset;
92 pageControl.frame = CGRectMake(0, 250, 480, 20);
93 [[[CCDirector sharedDirector] openGLView] addSubview:pageControl];
94
95 menu.position = ccpAdd(menu.position, ccp(totalWidth/2 - totalPanelWidth/2, 320));
96 touchDelegatingView = [[TouchDelegatingView alloc] initWithFrame:CGRectMake(0, 0, 480, 320)];
97 scrollView = [[CocosOverlayScrollView alloc] initWithFrame:CGRectMake(0, 0, totalPanelWidth, 320) numPages:numberOfPanels width:totalPanelWidth layer:panels pageControl:pageControl];
98 touchDelegatingView.scrollView = scrollView;
99 [scrollView setContentOffset:CGPointMake(currentWorldOffset*totalPanelWidth+1,0) animated:NO];
100 [[[CCDirector sharedDirector] openGLView] addSubview:touchDelegatingView];
101 [[[CCDirector sharedDirector] openGLView] addSubview:scrollView];
102
103 CCMenuItemImage* newgameMenuItem = [CCMenuItemImage itemFromNormalImage:@"back.png" selectedImage:@"back2.png" target:self selector:@selector(mainmenu)];
104 CCMenu* myMenu = [CCMenu menuWithItems:newgameMenuItem, nil];
105 myMenu.position = ccp(240, 30);
106 [self addChild:myMenu];
107 }
108
109 return self;
110}
111
112- (void)onExit
113{
114 [touchDelegatingView removeFromSuperview];
115 [scrollView removeFromSuperview];
116 [pageControl removeFromSuperview];
117}
118
119- (void)mainmenu
120{
121 [[CCDirector sharedDirector] replaceScene:[MainMenuLayer scene]];
122}
123
124- (void)didSelectGameMode:(GameModeSelection *)gameMode
125{
126 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
127 [defaults setInteger:[gameModes indexOfObject:gameMode] forKey:@"lastSelectedMode"];
128
129 if ([gameMode.name isEqual:@"Tutorial"])
130 {
131 [[CCDirector sharedDirector] replaceScene:[TutorialMode scene]];
132 } else if ([gameMode.name isEqual:@"Collect"])
133 {
134 [[CCDirector sharedDirector] replaceScene:[ClassicGameMode scene]];
135 }
136}
137
138@end
diff --git a/Classes/MainMenuLayer.h b/Classes/MainMenuLayer.h index 4914b59..439056c 100755 --- a/Classes/MainMenuLayer.h +++ b/Classes/MainMenuLayer.h
@@ -16,7 +16,6 @@
16+ (CCScene*)scene; 16+ (CCScene*)scene;
17- (id)init; 17- (id)init;
18- (void)newgame; 18- (void)newgame;
19- (void)tutorial;
20- (void)highscores; 19- (void)highscores;
21- (void)feedback; 20- (void)feedback;
22 21
diff --git a/Classes/MainMenuLayer.m b/Classes/MainMenuLayer.m index 32b85cb..d4a6331 100755 --- a/Classes/MainMenuLayer.m +++ b/Classes/MainMenuLayer.m
@@ -8,8 +8,7 @@
8 8
9#import "MainMenuLayer.h" 9#import "MainMenuLayer.h"
10#import "HighscoreListController.h" 10#import "HighscoreListController.h"
11#import "ClassicGameMode.h" 11#import "GameModeSelectionLayer.h"
12#import "TutorialMode.h"
13#import "Cart_CollectAppDelegate.h" 12#import "Cart_CollectAppDelegate.h"
14#import "TestFlight.h" 13#import "TestFlight.h"
15 14
@@ -46,11 +45,10 @@
46 //CCMenuItemLabel* menuItem2 = [CCMenuItemLabel itemWithLabel:menuItemLabel2 target:self selector:@selector(highscores)]; 45 //CCMenuItemLabel* menuItem2 = [CCMenuItemLabel itemWithLabel:menuItemLabel2 target:self selector:@selector(highscores)];
47 46
48 CCMenuItemImage* newgameMenuItem = [CCMenuItemImage itemFromNormalImage:@"newgame.png" selectedImage:@"newgame2.png" target:self selector:@selector(newgame)]; 47 CCMenuItemImage* newgameMenuItem = [CCMenuItemImage itemFromNormalImage:@"newgame.png" selectedImage:@"newgame2.png" target:self selector:@selector(newgame)];
49 CCMenuItemImage* tutorialMenuItem = [CCMenuItemImage itemFromNormalImage:@"tutorial.png" selectedImage:@"tutorial2.png" target:self selector:@selector(tutorial)];
50 CCMenuItemImage* highscoresMenuItem = [CCMenuItemImage itemFromNormalImage:@"highscores.png" selectedImage:@"highscores2.png" target:self selector:@selector(highscores)]; 48 CCMenuItemImage* highscoresMenuItem = [CCMenuItemImage itemFromNormalImage:@"highscores.png" selectedImage:@"highscores2.png" target:self selector:@selector(highscores)];
51 CCMenuItemImage* feedbackMenuItem = [CCMenuItemImage itemFromNormalImage:@"feedback.png" selectedImage:@"feedback2.png" target:self selector:@selector(feedback)]; 49 CCMenuItemImage* feedbackMenuItem = [CCMenuItemImage itemFromNormalImage:@"feedback.png" selectedImage:@"feedback2.png" target:self selector:@selector(feedback)];
52 50
53 CCMenu* menu = [CCMenu menuWithItems:newgameMenuItem, tutorialMenuItem, highscoresMenuItem, feedbackMenuItem, nil]; 51 CCMenu* menu = [CCMenu menuWithItems:newgameMenuItem, highscoresMenuItem, feedbackMenuItem, nil];
54 [menu alignItemsVertically]; 52 [menu alignItemsVertically];
55 menu.position = ccp(240, 100); 53 menu.position = ccp(240, 100);
56 [self addChild:menu]; 54 [self addChild:menu];
@@ -61,12 +59,7 @@
61 59
62- (void)newgame 60- (void)newgame
63{ 61{
64 [[CCDirector sharedDirector] replaceScene:[ClassicGameMode scene]]; 62 [[CCDirector sharedDirector] replaceScene:[GameModeSelectionLayer scene]];
65}
66
67- (void)tutorial
68{
69 [[CCDirector sharedDirector] replaceScene:[TutorialMode scene]];
70} 63}
71 64
72- (void)highscores 65- (void)highscores
diff --git a/Classes/NMPanelMenu.h b/Classes/NMPanelMenu.h new file mode 100755 index 0000000..3487849 --- /dev/null +++ b/Classes/NMPanelMenu.h
@@ -0,0 +1,14 @@
1/*
2 * NMPanelMenu.h
3 * shapes
4 *
5 * Created by Nate Murray on 7/29/10.
6 * Copyright 2010 YetiApps. All rights reserved.
7 *
8 */
9
10#import "cocos2d.h"
11@interface NMPanelMenu : CCMenu {
12}
13-(CCMenuItem *) itemForTouch: (UITouch *) touch;
14@end
diff --git a/Classes/NMPanelMenu.m b/Classes/NMPanelMenu.m new file mode 100755 index 0000000..ee24279 --- /dev/null +++ b/Classes/NMPanelMenu.m
@@ -0,0 +1,37 @@
1/*
2 * NMPanelMenu.m
3 * shapes
4 *
5 * Created by Nate Murray on 7/29/10.
6 * Copyright 2010 YetiApps. All rights reserved.
7 *
8 */
9
10#import "NMPanelMenu.h"
11
12@implementation NMPanelMenu
13
14-(CCMenuItem *) itemForTouch: (UITouch *) touch
15{
16 CGPoint touchLocation = [touch locationInView: [[touch view] superview]];
17 touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
18
19 CCMenuItem* item;
20 CCARRAY_FOREACH(children_, item){
21 // ignore invisible and disabled items: issue #779, #866
22 if ( [item visible] && [item isEnabled] ) {
23
24 CGPoint local = [item convertToNodeSpace:touchLocation];
25
26 CGRect r = [item rect];
27 r.origin = CGPointZero;
28
29 if( CGRectContainsPoint( r, local ) ) {
30 return item;
31 }
32 }
33 }
34 return nil;
35}
36
37@end
diff --git a/Classes/TouchDelegatingView.h b/Classes/TouchDelegatingView.h new file mode 100755 index 0000000..5ed6884 --- /dev/null +++ b/Classes/TouchDelegatingView.h
@@ -0,0 +1,18 @@
1//
2// TouchDelegatingView.h
3// shapes
4//
5// Created by Nate Murray on 8/23/10.
6// Copyright 2010 LittleHiccup. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "CocosOverLayScrollView.h"
11
12@interface TouchDelegatingView : UIView {
13 // UIPageControl* pageControl;
14 CocosOverlayScrollView* scrollView;
15}
16@property(nonatomic, retain) CocosOverlayScrollView* scrollView;
17
18@end
diff --git a/Classes/TouchDelegatingView.m b/Classes/TouchDelegatingView.m new file mode 100755 index 0000000..83bda73 --- /dev/null +++ b/Classes/TouchDelegatingView.m
@@ -0,0 +1,26 @@
1//
2// TouchDelegatingView.m
3// Jacob's Shapes
4//
5// Created by Nate Murray on 8/23/10.
6// Copyright 2010 LittleHiccup. All rights reserved.
7//
8
9#import "TouchDelegatingView.h"
10
11@implementation TouchDelegatingView
12@synthesize scrollView;
13
14- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
15 if ([self pointInside:point withEvent:event]) {
16 return self.scrollView;
17 }
18 return nil;
19}
20
21-(void) dealloc {
22 self.scrollView = nil;
23 [super dealloc];
24}
25
26@end
diff --git a/Classes/TutorialMode.m b/Classes/TutorialMode.m index 1ada34a..1285597 100644 --- a/Classes/TutorialMode.m +++ b/Classes/TutorialMode.m
@@ -12,7 +12,7 @@
12#import "Bottle.h" 12#import "Bottle.h"
13#import "OneUp.h" 13#import "OneUp.h"
14#import "Rock.h" 14#import "Rock.h"
15#import "MainMenuLayer.h" 15#import "GameModeSelectionLayer.h"
16 16
17// Item tags: 17// Item tags:
18// 2000 - first dropped item 18// 2000 - first dropped item
@@ -227,7 +227,7 @@
227 [self schedule:@selector(randomlyAddObject:) interval:1.0f]; 227 [self schedule:@selector(randomlyAddObject:) interval:1.0f];
228 } else if ([currentTutorial.name isEqual:@"end"]) 228 } else if ([currentTutorial.name isEqual:@"end"])
229 { 229 {
230 [[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:3.0f scene:[MainMenuLayer scene] withColor:ccc3(0,0,0)]]; 230 [[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:3.0f scene:[GameModeSelectionLayer scene] withColor:ccc3(0,0,0)]];
231 } 231 }
232 232
233 self.currentTutorial = nil; 233 self.currentTutorial = nil;
@@ -331,6 +331,9 @@
331 331
332 [self unschedule:@selector(randomlyAddObject:)]; 332 [self unschedule:@selector(randomlyAddObject:)];
333 333
334 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
335 [defaults setBool:YES forKey:@"hasDoneTutorial"];
336
334 return; 337 return;
335 } else { 338 } else {
336 NSLog(@"randomItemsDropped in TutorialMode is greater than 15--this should never happen."); 339 NSLog(@"randomItemsDropped in TutorialMode is greater than 15--this should never happen.");
diff --git a/Classes/UIImage+ColorMasking.h b/Classes/UIImage+ColorMasking.h new file mode 100644 index 0000000..d25fafb --- /dev/null +++ b/Classes/UIImage+ColorMasking.h
@@ -0,0 +1,15 @@
1//
2// UIImage+ColorMasking.h
3// Cartographic
4//
5// Created by Starla Insigna on 8/22/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10
11@interface UIImage (ColorMasking)
12
13- (UIImage *)opaqueMaskFromWhiteImage;
14
15@end
diff --git a/Classes/UIImage+ColorMasking.m b/Classes/UIImage+ColorMasking.m new file mode 100644 index 0000000..e4da8c8 --- /dev/null +++ b/Classes/UIImage+ColorMasking.m
@@ -0,0 +1,77 @@
1//
2// UIImage+ColorMasking.m
3// Cartographic
4//
5// Created by Starla Insigna on 8/22/11.
6// Copyright 2011 Four Island. All rights reserved.
7//
8
9#import "UIImage+ColorMasking.h"
10
11@implementation UIImage (ColorMasking)
12
13typedef enum {
14 ALPHA = 0,
15 BLUE = 1,
16 GREEN = 2,
17 RED = 3
18} PIXELS;
19
20- (UIImage *)opaqueMaskFromWhiteImage
21{
22 CGSize size = [self size];
23 int width = size.width;
24 int height = size.height;
25
26 // the pixels will be painted to this array
27 uint32_t *pixels = (uint32_t *) malloc(width * height * sizeof(uint32_t));
28
29 // clear the pixels so any transparency is preserved
30 memset(pixels, 0, width * height * sizeof(uint32_t));
31
32 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
33
34 // create a context with RGBA pixels
35 CGContextRef context = CGBitmapContextCreate(pixels, width, height, 8, width * sizeof(uint32_t), colorSpace,
36 kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedLast);
37
38 // paint the bitmap to our context which will fill in the pixels array
39 CGContextDrawImage(context, CGRectMake(0, 0, width, height), [self CGImage]);
40
41 for(int y = 0; y < height; y++) {
42 for(int x = 0; x < width; x++) {
43 uint8_t *rgbaPixel = (uint8_t *) &pixels[y * width + x];
44
45 if ((rgbaPixel[RED] == 255) && (rgbaPixel[GREEN] == 255) && (rgbaPixel[BLUE] == 255) && (rgbaPixel[ALPHA] == 255))
46 {
47 rgbaPixel[RED] = 255;
48 rgbaPixel[GREEN] = 255;
49 rgbaPixel[BLUE] = 255;
50 rgbaPixel[ALPHA] = 255;
51 } else {
52 rgbaPixel[RED] = 0;
53 rgbaPixel[GREEN] = 0;
54 rgbaPixel[BLUE] = 0;
55 rgbaPixel[ALPHA] = 0;
56 }
57 }
58 }
59
60 // create a new CGImageRef from our context with the modified pixels
61 CGImageRef image = CGBitmapContextCreateImage(context);
62
63 // we're done with the context, color space, and pixels
64 CGContextRelease(context);
65 CGColorSpaceRelease(colorSpace);
66 free(pixels);
67
68 // make a new UIImage to return
69 UIImage *resultUIImage = [UIImage imageWithCGImage:image];
70
71 // we're done with image now too
72 CGImageRelease(image);
73
74 return resultUIImage;
75}
76
77@end
diff --git a/Resources/Info.plist b/Resources/Info.plist index 9f3118a..92dca77 100755 --- a/Resources/Info.plist +++ b/Resources/Info.plist
@@ -27,7 +27,7 @@
27 <key>CFBundlePackageType</key> 27 <key>CFBundlePackageType</key>
28 <string>APPL</string> 28 <string>APPL</string>
29 <key>CFBundleShortVersionString</key> 29 <key>CFBundleShortVersionString</key>
30 <string>0.2.1</string> 30 <string>0.3</string>
31 <key>CFBundleSignature</key> 31 <key>CFBundleSignature</key>
32 <string>????</string> 32 <string>????</string>
33 <key>CFBundleURLTypes</key> 33 <key>CFBundleURLTypes</key>
diff --git a/Resources/florence.png b/Resources/florence.png new file mode 100644 index 0000000..6ad85dc --- /dev/null +++ b/Resources/florence.png
Binary files differ
diff --git a/Resources/paintdaubs.png b/Resources/paintdaubs.png new file mode 100644 index 0000000..9eb5995 --- /dev/null +++ b/Resources/paintdaubs.png
Binary files differ
diff --git a/Resources/paris.png b/Resources/paris.png new file mode 100644 index 0000000..59d95af --- /dev/null +++ b/Resources/paris.png
Binary files differ