0

他の通常のゲームのように宝石を交換するのではなく、宝石の行全体を水平または垂直にスクロールし、一致が発生した場所でそれを排除したい宝石ゲームを開発しています。

この宝石のスクロールを開発する方法を知っている人は誰でも、私は宝石のスプライトの配列を持っていますが、スプライトの行全体をスクロールする方法は?

参考: http: //imageshack.us/photo/my-images/146/img1253.png/

4

1 に答える 1

1

If you already have the array then your best bet would to use a for loop to increment through the sprites and manipulate them as needed. Probably something like this:

for(int i = 0; i < [yourArray count]; i++){
CCSprite *jewelSprite = [yourArray objectAtIndex:i];
[jewelSprite runAction:[CCMoveTo actionWithDuration:1.0 position:ccp(x,y)];
}

That would move all of the sprites in your array to a predefined position over the course of one second.

I'm not really sure this is what you need as the question is a bit vague. Hope it helps.

于 2011-06-21T14:52:21.730 に答える