他の通常のゲームのように宝石を交換するのではなく、宝石の行全体を水平または垂直にスクロールし、一致が発生した場所でそれを排除したい宝石ゲームを開発しています。
この宝石のスクロールを開発する方法を知っている人は誰でも、私は宝石のスプライトの配列を持っていますが、スプライトの行全体をスクロールする方法は?
他の通常のゲームのように宝石を交換するのではなく、宝石の行全体を水平または垂直にスクロールし、一致が発生した場所でそれを排除したい宝石ゲームを開発しています。
この宝石のスクロールを開発する方法を知っている人は誰でも、私は宝石のスプライトの配列を持っていますが、スプライトの行全体をスクロールする方法は?
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.