문제

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