i have problem with CCSequence that is running action , and i dont understand why i will be happy to know how to debug or solve the problem . this is my code :
void Gem::setGemPositionAnimation(Gem* other)
{
//get the current gem pos that is dragged down
CCPoint currentToPoint = this->mySprite->getPosition();
//get the original upper gem pos , that will be replaced with the gem which is down
CCPoint upperOrigGemPoint = getGemPos();
//CCLOG("Gem %s %s upperOrigGemPoint! x:%f ,y:%f",getImageName().c_str(),getGemId().c_str(),upperOrigGemPoint.x,upperOrigGemPoint.y);
//the down gem pos , that the upper gem suppose to go when dragged down
CCPoint otherOrigGemPoint = other->getGemPos();
//CCLOG("Gem %s %s moveToPoint! x:%f ,y:%f",other->getImageName().c_str(),other->getGemId().c_str(),moveToPoint.x,moveToPoint.y);
//down gem move up action
CCMoveTo *moveUp = CCMoveTo::create(0.3f,upperOrigGemPoint);
CCMoveTo *moveDown = CCMoveTo::create(0.3f,otherOrigGemPoint);
//CCActionInterval *moveUp = CCMoveTo::create(0.3f,upperOrigGemPoint);
//CCActionInterval *moveDown = CCMoveTo::create(0.3f,otherOrigGemPoint);
CCSequence* SequenceActionUpAndDown = CCSequence::create(moveUp,moveDown, NULL);
//CCAction* SequenceActionUpAndDown = CCSpawn::create( moveUp,moveDown, NULL);
other->mySprite->runAction(SequenceActionUpAndDown);
// upper gem move down action
CCSequence* SequenceActionDownAndUp = CCSequence::create( moveDown,moveUp, NULL);
//CCAction *SequenceActionDownAndUp = CCSpawn::create(moveDown,moveUp, NULL);
mySprite->runAction(SequenceActionDownAndUp);
}
now in the SequenceActionUpAndDown CCAction the moveDown doesn't do the animation of moving down it just jumps to its "down"( CCMoveTo *moveDown ) location
the up (CCMoveTo *moveUp) animation is working fine .
and the other gem SequenceActionDownAndUp animation is working fine .
what can be the problem ?
each gem is CCSprit on different z order
both sequences run the same actions, you need to create individual actions for each sequence.