From fd58a0cde1bb5473e39e6cb82d28113da84b9ae0 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 10 Sep 2011 17:07:13 -0400 Subject: Reworked falling objects Previously, every type of falling object had to have its own class that defined the object type's sprite, weight, and reaction to the cart/floor. This was pretty messy considering how many object types may only be used in one game mode--for instance, the many power ups in Power mode, once it's created, will never be used outside of Power mode. So, to increase customizability and decrease class clutter, game modes now use a FallingObjectFactory to define recipes (basically a sprite filename, a weight and an identifier) that can easily be built throughout the game mode using the identifier. FallingObjectDelegate is now used for all reactions to the cart/floor, rather than defining a standard reaction in the FallingObject subclass and then putting extra stuff in FallingObjectDelegate. --- Cartographic.xcodeproj/project.pbxproj | 44 ++++++---------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) (limited to 'Cartographic.xcodeproj') diff --git a/Cartographic.xcodeproj/project.pbxproj b/Cartographic.xcodeproj/project.pbxproj index 75343b3..5aed3f5 100755 --- a/Cartographic.xcodeproj/project.pbxproj +++ b/Cartographic.xcodeproj/project.pbxproj @@ -31,14 +31,10 @@ 3F6C7C3413D5DEB100C038FE /* Damage1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7C3313D5DEB100C038FE /* Damage1.wav */; }; 3F6C7C4913D5DEDB00C038FE /* Item1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7C4813D5DEDB00C038FE /* Item1.wav */; }; 3F6C7C4F13D5E1B600C038FE /* FallingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C7C4E13D5E1B600C038FE /* FallingObject.m */; }; - 3F6C7C6D13D5E51800C038FE /* Cherry.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C7C6C13D5E51800C038FE /* Cherry.m */; }; - 3F6C7C7013D5E54E00C038FE /* Bottle.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C7C6F13D5E54E00C038FE /* Bottle.m */; }; - 3F6C7C7313D5E57100C038FE /* OneUp.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C7C7213D5E57100C038FE /* OneUp.m */; }; 3F6C7E9C13D6315D00C038FE /* helvetica.fnt in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7E9B13D6315D00C038FE /* helvetica.fnt */; }; 3F6C7EAD13D6323600C038FE /* helvetica.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7EAC13D6323600C038FE /* helvetica.png */; }; 3F6C7EC613D6335A00C038FE /* 1up.wav in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7EC513D6335A00C038FE /* 1up.wav */; }; 3F6C7EE113D636BE00C038FE /* rock.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7EE013D636BE00C038FE /* rock.png */; }; - 3F6C7EE413D636CF00C038FE /* Rock.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C7EE313D636CF00C038FE /* Rock.m */; }; 3F6C7EE913D6377D00C038FE /* GameOverScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C7EE813D6377D00C038FE /* GameOverScene.m */; }; 3F6C7F2413D63E6500C038FE /* SeaBeach.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7F2313D63E6500C038FE /* SeaBeach.png */; }; 3F6C7F4B13D647A600C038FE /* GameOver.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F6C7F4A13D647A600C038FE /* GameOver.png */; }; @@ -98,7 +94,6 @@ 50F4144910692EE7002A0D5E /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 50F4144410692EE7002A0D5E /* Default.png */; }; 50F4144A10692EE7002A0D5E /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 50F4144510692EE7002A0D5E /* fps_images.png */; }; 50F4144B10692EE7002A0D5E /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 50F4144610692EE7002A0D5E /* Icon.png */; }; - 6C0C140E13F1C3EC003A31B2 /* ValuableObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C140D13F1C3EC003A31B2 /* ValuableObject.m */; }; 6C0C141113F2099B003A31B2 /* Cart.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C141013F2099B003A31B2 /* Cart.m */; }; 6C0C141413F20E98003A31B2 /* GameMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0C141313F20E98003A31B2 /* GameMode.m */; }; 6C18C3CA1402AD9C0005AA4C /* UIImage+ColorMasking.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C18C3C91402AD9C0005AA4C /* UIImage+ColorMasking.m */; }; @@ -129,9 +124,9 @@ 6CC89DD913F2F4E6003704F7 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6CC89DD813F2F4E6003704F7 /* Entitlements.plist */; }; 6CC89DDF13F31413003704F7 /* TutorialMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CC89DDE13F31413003704F7 /* TutorialMode.m */; }; 6CDBE80C14092DB00072F287 /* ledge.png in Resources */ = {isa = PBXBuildFile; fileRef = 6CDBE80B14092DB00072F287 /* ledge.png */; }; - 6CF64C09141B9FA300F3B702 /* PointMultiplier.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CF64C08141B9FA300F3B702 /* PointMultiplier.m */; }; 6CF64C0B141BA37000F3B702 /* multiplier.png in Resources */ = {isa = PBXBuildFile; fileRef = 6CF64C0A141BA37000F3B702 /* multiplier.png */; }; 6CF64C11141BA84200F3B702 /* Absorption2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6CF64C10141BA84200F3B702 /* Absorption2.wav */; }; + 6CF64C1D141BFA9600F3B702 /* FallingObjectFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CF64C1C141BFA9600F3B702 /* FallingObjectFactory.m */; }; DC6640030F83B3EA000B3E49 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC6640020F83B3EA000B3E49 /* AudioToolbox.framework */; }; DC6640050F83B3EA000B3E49 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC6640040F83B3EA000B3E49 /* OpenAL.framework */; }; DCCBF1B70F6022AE0040855A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCBF1B60F6022AE0040855A /* CoreGraphics.framework */; }; @@ -354,18 +349,10 @@ 3F6C7C4813D5DEDB00C038FE /* Item1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Item1.wav; sourceTree = ""; }; 3F6C7C4D13D5E1B600C038FE /* FallingObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FallingObject.h; sourceTree = ""; }; 3F6C7C4E13D5E1B600C038FE /* FallingObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FallingObject.m; sourceTree = ""; }; - 3F6C7C6B13D5E51800C038FE /* Cherry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cherry.h; sourceTree = ""; }; - 3F6C7C6C13D5E51800C038FE /* Cherry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cherry.m; sourceTree = ""; }; - 3F6C7C6E13D5E54E00C038FE /* Bottle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bottle.h; sourceTree = ""; }; - 3F6C7C6F13D5E54E00C038FE /* Bottle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bottle.m; sourceTree = ""; }; - 3F6C7C7113D5E57100C038FE /* OneUp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneUp.h; sourceTree = ""; }; - 3F6C7C7213D5E57100C038FE /* OneUp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OneUp.m; sourceTree = ""; }; 3F6C7E9B13D6315D00C038FE /* helvetica.fnt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = helvetica.fnt; sourceTree = ""; }; 3F6C7EAC13D6323600C038FE /* helvetica.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = helvetica.png; sourceTree = ""; }; 3F6C7EC513D6335A00C038FE /* 1up.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = 1up.wav; sourceTree = ""; }; 3F6C7EE013D636BE00C038FE /* rock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rock.png; sourceTree = ""; }; - 3F6C7EE213D636CF00C038FE /* Rock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Rock.h; sourceTree = ""; }; - 3F6C7EE313D636CF00C038FE /* Rock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Rock.m; sourceTree = ""; }; 3F6C7EE713D6377D00C038FE /* GameOverScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameOverScene.h; sourceTree = ""; }; 3F6C7EE813D6377D00C038FE /* GameOverScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameOverScene.m; sourceTree = ""; }; 3F6C7F2313D63E6500C038FE /* SeaBeach.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SeaBeach.png; sourceTree = ""; }; @@ -424,8 +411,6 @@ 50F4144510692EE7002A0D5E /* fps_images.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = fps_images.png; sourceTree = ""; }; 50F4144610692EE7002A0D5E /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; 50F4144710692EE7002A0D5E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6C0C140C13F1C3EC003A31B2 /* ValuableObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValuableObject.h; sourceTree = ""; }; - 6C0C140D13F1C3EC003A31B2 /* ValuableObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ValuableObject.m; sourceTree = ""; }; 6C0C140F13F2099B003A31B2 /* Cart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cart.h; sourceTree = ""; }; 6C0C141013F2099B003A31B2 /* Cart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cart.m; sourceTree = ""; }; 6C0C141213F20E98003A31B2 /* GameMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameMode.h; sourceTree = ""; }; @@ -474,10 +459,10 @@ 6CC89DE013F3197F003704F7 /* FallingObjectDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FallingObjectDelegate.h; sourceTree = ""; }; 6CDBE80B14092DB00072F287 /* ledge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ledge.png; sourceTree = ""; }; 6CDBE80E140936CF0072F287 /* CartDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CartDelegate.h; sourceTree = ""; }; - 6CF64C07141B9FA300F3B702 /* PointMultiplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PointMultiplier.h; sourceTree = ""; }; - 6CF64C08141B9FA300F3B702 /* PointMultiplier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PointMultiplier.m; sourceTree = ""; }; 6CF64C0A141BA37000F3B702 /* multiplier.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = multiplier.png; sourceTree = ""; }; 6CF64C10141BA84200F3B702 /* Absorption2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Absorption2.wav; sourceTree = ""; }; + 6CF64C1B141BFA9600F3B702 /* FallingObjectFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FallingObjectFactory.h; sourceTree = ""; }; + 6CF64C1C141BFA9600F3B702 /* FallingObjectFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FallingObjectFactory.m; sourceTree = ""; }; DC6640020F83B3EA000B3E49 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; DC6640040F83B3EA000B3E49 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; DCCBF1B60F6022AE0040855A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; @@ -968,22 +953,12 @@ children = ( 3F6C7C4D13D5E1B600C038FE /* FallingObject.h */, 3F6C7C4E13D5E1B600C038FE /* FallingObject.m */, - 3F6C7C6B13D5E51800C038FE /* Cherry.h */, - 3F6C7C6C13D5E51800C038FE /* Cherry.m */, - 3F6C7C6E13D5E54E00C038FE /* Bottle.h */, - 3F6C7C6F13D5E54E00C038FE /* Bottle.m */, - 3F6C7C7113D5E57100C038FE /* OneUp.h */, - 3F6C7C7213D5E57100C038FE /* OneUp.m */, - 3F6C7EE213D636CF00C038FE /* Rock.h */, - 3F6C7EE313D636CF00C038FE /* Rock.m */, - 6C0C140C13F1C3EC003A31B2 /* ValuableObject.h */, - 6C0C140D13F1C3EC003A31B2 /* ValuableObject.m */, + 6CC89DE013F3197F003704F7 /* FallingObjectDelegate.h */, + 6CF64C1B141BFA9600F3B702 /* FallingObjectFactory.h */, + 6CF64C1C141BFA9600F3B702 /* FallingObjectFactory.m */, 6C0C140F13F2099B003A31B2 /* Cart.h */, 6C0C141013F2099B003A31B2 /* Cart.m */, - 6CC89DE013F3197F003704F7 /* FallingObjectDelegate.h */, 6CDBE80E140936CF0072F287 /* CartDelegate.h */, - 6CF64C07141B9FA300F3B702 /* PointMultiplier.h */, - 6CF64C08141B9FA300F3B702 /* PointMultiplier.m */, ); name = Items; sourceTree = ""; @@ -1523,16 +1498,11 @@ E0F81038120A173C005866B8 /* RootViewController.m in Sources */, 3FE79CD413D4DE37001A6B93 /* ClassicGameMode.m in Sources */, 3F6C7C4F13D5E1B600C038FE /* FallingObject.m in Sources */, - 3F6C7C6D13D5E51800C038FE /* Cherry.m in Sources */, - 3F6C7C7013D5E54E00C038FE /* Bottle.m in Sources */, - 3F6C7C7313D5E57100C038FE /* OneUp.m in Sources */, - 3F6C7EE413D636CF00C038FE /* Rock.m in Sources */, 3F6C7EE913D6377D00C038FE /* GameOverScene.m in Sources */, 3F83955313D739B10059AEE8 /* MainMenuLayer.m in Sources */, 3F03221613D78F8C00E6A708 /* HighscoreListController.m in Sources */, 3F03221913D7904E00E6A708 /* Highscore.m in Sources */, 6C29041013EAEB590032DA0F /* TutorialBubble.m in Sources */, - 6C0C140E13F1C3EC003A31B2 /* ValuableObject.m in Sources */, 6C0C141113F2099B003A31B2 /* Cart.m in Sources */, 6C0C141413F20E98003A31B2 /* GameMode.m in Sources */, 6CC89DDF13F31413003704F7 /* TutorialMode.m in Sources */, @@ -1546,7 +1516,7 @@ 6C85834014055A44009EF100 /* CCNotifications.m in Sources */, 6C85834414055B2E009EF100 /* notificationDesign.m in Sources */, 6C4400041415080800A9E1D7 /* ZoomFadeTransition.m in Sources */, - 6CF64C09141B9FA300F3B702 /* PointMultiplier.m in Sources */, + 6CF64C1D141BFA9600F3B702 /* FallingObjectFactory.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- cgit 1.4.1