summary refs log tree commit diff stats
path: root/Classes/ClassicGameMode.h
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-09-10 17:07:13 -0400
committerStarla Insigna <starla4444@gmail.com>2011-09-10 17:07:13 -0400
commitfd58a0cde1bb5473e39e6cb82d28113da84b9ae0 (patch)
tree8d36b2fedc3c056c002a881e78340c7b56bbabea /Classes/ClassicGameMode.h
parent5ccc4fc305f502a552b1ac7e815e576c93a8159a (diff)
downloadcartcollect-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/ClassicGameMode.h')
-rwxr-xr-xClasses/ClassicGameMode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Classes/ClassicGameMode.h b/Classes/ClassicGameMode.h index bbce029..898a5e7 100755 --- a/Classes/ClassicGameMode.h +++ b/Classes/ClassicGameMode.h
@@ -9,8 +9,9 @@
9#import <Foundation/Foundation.h> 9#import <Foundation/Foundation.h>
10#import "cocos2d.h" 10#import "cocos2d.h"
11#import "GameMode.h" 11#import "GameMode.h"
12#import "FallingObjectDelegate.h"
12 13
13@interface ClassicGameMode : GameMode { 14@interface ClassicGameMode : GameMode <FallingObjectDelegate> {
14 float addSpeed; 15 float addSpeed;
15} 16}
16 17