Question

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/

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top