File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 59
59
@end
60
60
61
61
62
+ #pragma mark - Ease Sine Actions
63
+ /* *
64
+ * This action will start the specified action with an sine effect.
65
+ *
66
+ * Note: This action doesn't use a bijective function, actions like CCActionSequence might have an unexpected result when used with this action.
67
+ */
68
+ @interface CCActionEaseSineIn : CCActionEase <NSCopying >
69
+ @end
70
+
71
+ /* *
72
+ * This action will start the specified action with an sine effect.
73
+ *
74
+ * Note: This action doesn't use a bijective function, actions like CCActionSequence might have an unexpected result when used with this action.
75
+ */
76
+ @interface CCActionEaseSineOut : CCActionEase <NSCopying >
77
+ @end
78
+
79
+ /* *
80
+ * This action will start the specified action with an sine effect.
81
+ *
82
+ * Note: This action doesn't use a bijective function, actions like CCActionSequence might have an unexpected result when used with this action.
83
+ */
84
+ @interface CCActionEaseSineInOut : CCActionEase <NSCopying >
85
+ @end
86
+
62
87
/* *
63
88
* This action will start the specified action with a reversed acceleration.
64
89
*
Original file line number Diff line number Diff line change @@ -93,6 +93,47 @@ -(CCActionInterval*) reverse
93
93
@end
94
94
95
95
96
+ #pragma mark - Ease Sine Actions
97
+ //
98
+ // EaseSineIn
99
+ //
100
+ @implementation CCActionEaseSineIn
101
+ -(void ) update : (CCTime) t
102
+ {
103
+ [_inner update: -1 *cosf (t * (float )M_PI_2) +1 ];
104
+ }
105
+
106
+ - (CCActionInterval*) reverse
107
+ {
108
+ return [CCActionEaseSineOut actionWithAction: [_inner reverse ]];
109
+ }
110
+ @end
111
+
112
+ //
113
+ // EaseSineOut
114
+ //
115
+ @implementation CCActionEaseSineOut
116
+ -(void ) update : (CCTime) t
117
+ {
118
+ [_inner update: sinf (t * (float )M_PI_2)];
119
+ }
120
+
121
+ - (CCActionInterval*) reverse
122
+ {
123
+ return [CCActionEaseSineIn actionWithAction: [_inner reverse ]];
124
+ }
125
+ @end
126
+
127
+ //
128
+ // EaseSineInOut
129
+ //
130
+ @implementation CCActionEaseSineInOut
131
+ -(void ) update : (CCTime) t
132
+ {
133
+ [_inner update: -0 .5f *(cosf ( (float )M_PI*t) - 1 )];
134
+ }
135
+ @end
136
+
96
137
#pragma mark -
97
138
#pragma mark EaseRate
98
139
You can’t perform that action at this time.
0 commit comments