@@ -52,7 +52,7 @@ var PatternMatrix = cc.Layer.extend({
52
52
this . setTag ( 111 ) ;
53
53
54
54
var bgSprite = cc . Sprite . create ( "res/background.jpg" ) ;
55
- bgSprite . setAnchorPoint ( cc . p ( 0 , 0 ) ) ;
55
+ bgSprite . setAnchorPoint ( cc . ANCHOR_BOTTOM_LEFT ) ;
56
56
this . addChild ( bgSprite ) ;
57
57
58
58
this . initProgressWithGameMode ( ) ;
@@ -66,11 +66,11 @@ var PatternMatrix = cc.Layer.extend({
66
66
this . addChild ( this . mPatternBatchNode , 1 ) ;
67
67
68
68
this . mCheckMarkSpr = cc . Sprite . createWithSpriteFrameName ( "pattern_selected.png" ) ;
69
- this . mCheckMarkSpr . setPosition ( cc . p ( - 100.0 , - 100.0 ) ) ;
69
+ this . mCheckMarkSpr . setPosition ( - 100.0 , - 100.0 ) ;
70
70
this . addChild ( this . mCheckMarkSpr , 1 ) ;
71
71
72
72
this . mPromptMarkSpr = cc . Sprite . createWithSpriteFrameName ( "pattern_selected.png" ) ;
73
- this . mPromptMarkSpr . setPosition ( cc . p ( - 100.0 , - 100.0 ) ) ;
73
+ this . mPromptMarkSpr . setPosition ( - 100.0 , - 100.0 ) ;
74
74
this . addChild ( this . mPromptMarkSpr , 1 ) ;
75
75
76
76
this . mPromptMarkSpr . runAction ( cc . RepeatForever . create ( cc . Sequence . create ( cc . FadeIn . create ( 1.0 ) , cc . FadeOut . create ( 1.0 ) ) ) ) ;
@@ -151,18 +151,18 @@ var PatternMatrix = cc.Layer.extend({
151
151
var patternType = 0 | ( temp % this . mPatternTypeMax ) ;
152
152
153
153
this . mPatternsSpr [ row ] [ col ] = new PatternSprite ( patternType , attr ) ;
154
- this . mPatternsSpr [ row ] [ col ] . setAnchorPoint ( cc . p ( 0.5 , 0.5 ) ) ;
154
+ this . mPatternsSpr [ row ] [ col ] . setAnchorPoint ( cc . ANCHOR_MIDDLE ) ;
155
155
this . mPatternsSpr [ row ] [ col ] . m_nRowIndex = row ;
156
156
this . mPatternsSpr [ row ] [ col ] . m_nColIndex = col ;
157
- this . mPatternsSpr [ row ] [ col ] . setPosition ( cc . p ( this . mPatternsPos [ row ] [ col ] . x , this . mPatternsPos [ row ] [ col ] . y + 400.0 ) ) ;
157
+ this . mPatternsSpr [ row ] [ col ] . setPosition ( this . mPatternsPos [ row ] [ col ] . x , this . mPatternsPos [ row ] [ col ] . y + 400.0 ) ;
158
158
this . mPatternsSpr [ row ] [ col ] . moveTo ( gPatternsFallTime , this . mPatternsPos [ row ] [ col ] ) ;
159
159
160
160
this . mPatternBatchNode . addChild ( this . mPatternsSpr [ row ] [ col ] ) ;
161
161
} ,
162
162
initProgressWithGameMode :function ( ) {
163
163
this . mProgressBgSpr = cc . Sprite . create ( "res/ProgressBarBack.png" ) ;
164
- this . mProgressBgSpr . setAnchorPoint ( cc . p ( 0.0 , 0.5 ) ) ;
165
- this . mProgressBgSpr . setPosition ( cc . p ( 32 , 20 ) ) ;
164
+ this . mProgressBgSpr . setAnchorPoint ( cc . ANCHOR_MIDDLE_LEFT ) ;
165
+ this . mProgressBgSpr . setPosition ( 32 , 20 ) ;
166
166
this . addChild ( this . mProgressBgSpr ) ;
167
167
168
168
this . mProgressSpr = cc . Sprite . create ( "res/ProgressBarFront.png" ) ;
@@ -180,14 +180,14 @@ var PatternMatrix = cc.Layer.extend({
180
180
break ;
181
181
}
182
182
}
183
- this . mProgressSpr . setAnchorPoint ( cc . p ( 0.0 , 0.5 ) ) ;
184
- this . mProgressSpr . setPosition ( cc . p ( 32 , 20 ) ) ;
183
+ this . mProgressSpr . setAnchorPoint ( cc . ANCHOR_MIDDLE_LEFT ) ;
184
+ this . mProgressSpr . setPosition ( 32 , 20 ) ;
185
185
this . mProgressSpr . setTextureRect ( this . mVisibleRect ) ;
186
186
this . addChild ( this . mProgressSpr ) ;
187
187
} ,
188
188
initLabels :function ( ) {
189
189
this . mScoreLabel = cc . LabelTTF . create ( "Score 0" , "Courier" , 20 ) ;
190
- this . mScoreLabel . setPosition ( cc . p ( 150 , 450 ) ) ;
190
+ this . mScoreLabel . setPosition ( 150 , 450 ) ;
191
191
192
192
this . addChild ( this . mScoreLabel ) ;
193
193
} ,
@@ -231,7 +231,7 @@ var PatternMatrix = cc.Layer.extend({
231
231
onCheckPattern :function ( pPattern ) {
232
232
if ( pPattern != null ) {
233
233
this . mPromptTimerTally = 0 ;
234
- this . mPromptMarkSpr . setPosition ( cc . p ( - 1000.0 , - 1000.0 ) ) ;
234
+ this . mPromptMarkSpr . setPosition ( - 1000.0 , - 1000.0 ) ;
235
235
236
236
if ( this . mFirstCheckPattern === null ) {
237
237
this . mFirstCheckPattern = pPattern ;
@@ -266,7 +266,7 @@ var PatternMatrix = cc.Layer.extend({
266
266
}
267
267
268
268
if ( isAdjacent ) {
269
- this . mCheckMarkSpr . setPosition ( cc . p ( - 1000.0 , - 1000.0 ) ) ;
269
+ this . mCheckMarkSpr . setPosition ( - 1000.0 , - 1000.0 ) ;
270
270
271
271
this . swapTwoPattern ( this . mFirstCheckPattern , this . mSecondCheckPattern , false ) ;
272
272
this . mFirstCheckPattern = null ;
@@ -288,14 +288,14 @@ var PatternMatrix = cc.Layer.extend({
288
288
var pFirstCheckPattern = pPattern ;
289
289
if ( this . mFirstCheckPattern === pFirstCheckPattern ) {
290
290
this . mFirstCheckPattern = null ;
291
- this . mCheckMarkSpr . setPosition ( cc . p ( - 1000.0 , - 1000.0 ) ) ;
291
+ this . mCheckMarkSpr . setPosition ( - 1000.0 , - 1000.0 ) ;
292
292
}
293
293
294
294
if ( pFirstCheckPattern . g_ePatternStatus != ePatternStatus . Normal )
295
295
return ;
296
296
297
297
this . mPromptTimerTally = 0 ;
298
- this . mPromptMarkSpr . setPosition ( cc . p ( - 1000.0 , - 1000.0 ) ) ;
298
+ this . mPromptMarkSpr . setPosition ( - 1000.0 , - 1000.0 ) ;
299
299
300
300
var pSecondCheckPattern = null ;
301
301
switch ( pFirstCheckPattern . m_eSwapDirection ) {
@@ -324,7 +324,7 @@ var PatternMatrix = cc.Layer.extend({
324
324
if ( pSecondCheckPattern && pSecondCheckPattern . g_ePatternStatus == ePatternStatus . Normal ) {
325
325
if ( this . mFirstCheckPattern == pSecondCheckPattern ) {
326
326
this . mFirstCheckPattern = null ;
327
- this . mCheckMarkSpr . setPosition ( cc . p ( - 1000.0 , - 1000.0 ) ) ;
327
+ this . mCheckMarkSpr . setPosition ( - 1000.0 , - 1000.0 ) ;
328
328
}
329
329
this . swapTwoPattern ( pFirstCheckPattern , pSecondCheckPattern , false ) ;
330
330
}
@@ -476,7 +476,7 @@ var PatternMatrix = cc.Layer.extend({
476
476
}
477
477
478
478
if ( this . mPatternsSpr [ notnull_r ] [ col ] == this . mFirstCheckPattern ) {
479
- this . mCheckMarkSpr . setPosition ( cc . p ( - 100.0 , - 100.0 ) ) ;
479
+ this . mCheckMarkSpr . setPosition ( - 100.0 , - 100.0 ) ;
480
480
this . mFirstCheckPattern = null ;
481
481
}
482
482
0 commit comments