Basically i want to be able to dispatch movement animation of N number of sprites
the first one is at the start the second is 10 px behind him and the third sprite 10px
behind the second. and so on … the problem is when i loop the vector of sprites i like to animate they all move in the same time . this is what i have :
Vector<Node*> OnlyCoinsContainertChildren = this->pOnlyCoinsContainer->getChildren();
for (auto iter = OnlyCoinsContainertChildren.begin(); iter != OnlyCoinsContainertChildren.end(); ++iter)
{
Sign* pCoin = static_cast<Sign*>(*iter);
if(pCoin->getTag() == COIN)
{
auto action1 = Sequence::create(
MoveBy::create(1.0f,vec),
// DelayTime::create(1.0f),
CallFunc::create( std::bind(&SolutionContainer::CoinsToScoreViewAnimationCallback,
this,
pCoin)),
RemoveSelf::create(),
NULL);
pCoin->runAction(action1);
}
}
void SolutionContainer::CoinsToScoreViewAnimationCallback(Node* sender)
{
++iCoinsToScoreCount;
if(iNumberOfCoinsCount==iCoinsToScoreCount)
{
this->InnerCleanPreviousLevel();
}
}