diff options
author | Starla Insigna <starla4444@gmail.com> | 2011-09-10 17:07:13 -0400 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2011-09-10 17:07:13 -0400 |
commit | fd58a0cde1bb5473e39e6cb82d28113da84b9ae0 (patch) | |
tree | 8d36b2fedc3c056c002a881e78340c7b56bbabea /Classes/JumpGameMode.h | |
parent | 5ccc4fc305f502a552b1ac7e815e576c93a8159a (diff) | |
download | cartcollect-fd58a0cde1bb5473e39e6cb82d28113da84b9ae0.tar.gz cartcollect-fd58a0cde1bb5473e39e6cb82d28113da84b9ae0.tar.bz2 cartcollect-fd58a0cde1bb5473e39e6cb82d28113da84b9ae0.zip |
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.
Diffstat (limited to 'Classes/JumpGameMode.h')
-rw-r--r-- | Classes/JumpGameMode.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Classes/JumpGameMode.h b/Classes/JumpGameMode.h index 0b6c5d2..b18fd5a 100644 --- a/Classes/JumpGameMode.h +++ b/Classes/JumpGameMode.h | |||
@@ -7,10 +7,11 @@ | |||
7 | // | 7 | // |
8 | 8 | ||
9 | #import "GameMode.h" | 9 | #import "GameMode.h" |
10 | #import "FallingObjectDelegate.h" | ||
10 | 11 | ||
11 | @class LedgeFactory; | 12 | @class LedgeFactory; |
12 | 13 | ||
13 | @interface JumpGameMode : GameMode <CCStandardTouchDelegate> { | 14 | @interface JumpGameMode : GameMode <CCStandardTouchDelegate, FallingObjectDelegate> { |
14 | CCSprite* water; | 15 | CCSprite* water; |
15 | int waterTick; | 16 | int waterTick; |
16 | BOOL wave; | 17 | BOOL wave; |
@@ -20,7 +21,7 @@ | |||
20 | BOOL jump; | 21 | BOOL jump; |
21 | float expectedAngle; | 22 | float expectedAngle; |
22 | NSMutableSet* ledges; | 23 | NSMutableSet* ledges; |
23 | LedgeFactory* factory; | 24 | LedgeFactory* ledgeFactory; |
24 | int ledgeScrollSpeed; | 25 | int ledgeScrollSpeed; |
25 | float ledgeAccelerationRate; | 26 | float ledgeAccelerationRate; |
26 | float addSpeed; | 27 | float addSpeed; |