I am developing a jewel game, where I want to scroll the whole jewel line horizontally or vertically instead of swapping it as other normal game does, and where match occur eliminating it.

any body have idea how to develop this scrolling of jewel, I have the array of sprites of jewel, but how to scroll whole line of sprite ?

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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top