00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #import <UIKit/UIKit.h>
00028 #include <sys/time.h>
00029
00030 #import "ccTypes.h"
00031
00032 enum {
00034 kCCActionTagInvalid = -1,
00035 };
00036
00039 @interface CCAction : NSObject <NSCopying> {
00040 id originalTarget;
00041 id target;
00042 int tag;
00043 }
00044
00050 @property (nonatomic,readonly,assign) id target;
00051
00056 @property (nonatomic,readonly,assign) id originalTarget;
00057
00058
00060 @property (nonatomic,readwrite,assign) int tag;
00061
00063 +(id) action;
00064
00066 -(id) init;
00067
00068 -(id) copyWithZone: (NSZone*) zone;
00069
00071 -(BOOL) isDone;
00073 -(void) startWithTarget:(id)target;
00076 -(void) stop;
00078 -(void) step: (ccTime) dt;
00084 -(void) update: (ccTime) time;
00085
00086 @end
00087
00094 @interface CCFiniteTimeAction : CCAction <NSCopying>
00095 {
00097 ccTime duration;
00098 }
00100 @property (nonatomic,readwrite) ccTime duration;
00101
00103 - (CCFiniteTimeAction*) reverse;
00104 @end
00105
00106
00107 @class CCIntervalAction;
00112 @interface CCRepeatForever : CCAction <NSCopying>
00113 {
00114 CCIntervalAction *other;
00115 }
00117 +(id) actionWithAction: (CCIntervalAction*) action;
00119 -(id) initWithAction: (CCIntervalAction*) action;
00120 @end
00121
00127 @interface CCSpeed : CCAction <NSCopying>
00128 {
00129 CCIntervalAction *other;
00130 float speed;
00131 }
00133 @property (nonatomic,readwrite) float speed;
00135 +(id) actionWithAction: (CCIntervalAction*) action speed:(float)rate;
00137 -(id) initWithAction: (CCIntervalAction*) action speed:(float)rate;
00138 @end
00139
00140 @class CCNode;
00149 @interface CCFollow : CCAction <NSCopying>
00150 {
00151
00152 CCNode *followedNode_;
00153
00154
00155 BOOL boundarySet;
00156
00157
00158 BOOL boundaryFullyCovered;
00159
00160
00161 CGPoint halfScreenSize;
00162 CGPoint fullScreenSize;
00163
00164
00165 float leftBoundary;
00166 float rightBoundary;
00167 float topBoundary;
00168 float bottomBoundary;
00169 }
00170
00172 @property (nonatomic,readwrite) BOOL boundarySet;
00173
00175 +(id) actionWithTarget:(CCNode *)followedNode;
00176
00178 +(id) actionWithTarget:(CCNode *)followedNode worldBoundary:(CGRect)rect;
00179
00181 -(id) initWithTarget:(CCNode *)followedNode;
00182
00184 -(id) initWithTarget:(CCNode *)followedNode worldBoundary:(CGRect)rect;
00185
00186 @end
00187