开发者

How can I check the 5 ccspirits have passed through the screen on iPhone?

I have many ccspirits in NSMutableArray, and I am taking them from these NSMutableArray, and sending to as method as a sender, and following

   id actionMove2 = [CCMoveTo actionWithDuration:6 position:ccp(40, 520)];
   id actionMoveDone2 = [CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];

  [sender runAction:[CCSequence actions:actionMove2, actionMoveDone2, nil]];

now I want to calculate that five ccspirit has passed through the screen because the user is draging and droping many items so these will not be included, how can I do 开发者_如何转开发?


Alright so if you want to subtract out the images that were moved by the user. I'm assuming you have some code in place in your ccTouchesMoved or Began that checks if the touch is on a sprite and moves it accordingly. If that's the case I think (havent tested) that you could remove that object from your array by calling

[myArray removeObject:sender];

Then you could just keep track of how many objects are in there by checking it's count

[myArray count];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜