Question of using CCRepeat


#1

this is my test
please see code below.


CCDelayTime * pTestDelayTime = CCDelayTime::create(0.05);
CCCallFunc * pTestCallFunc = CCCallFunc::create(this, (SEL_CallFunc)(&TestScene::testCallFunc));
CCRepeat * pTestRepeat = CCRepeat::create(CCSequence::createWithTwoActions(pTestDelayTime, pTestCallFunc), 3);
runAction(pTestRepeat);

void TestScene::testCallFunc(void)
{
CCLOG (“TEST”);
}

the output is:

Cocos2d: TEST
Cocos2d: TEST
Cocos2d: TEST
Cocos2d: TEST << ???

but just to change the delay time or times
I get a correct output

(1) change “delay time”


CCDelayTime * pTestDelayTime = CCDelayTime::create(0); << to 0 or 0.5 …
CCCallFunc * pTestCallFunc = CCCallFunc::create(this, (SEL_CallFunc)(&TestScene::callFunc));
CCRepeat * pTestRepeat = CCRepeat::create(CCSequence::createWithTwoActions(pTestDelayTime, pTestCallFunc), 3);

Cocos2d: TEST
Cocos2d: TEST
Cocos2d: TEST

(2) change “times”


CCDelayTime * pTestDelayTime = CCDelayTime::create(0.05);
CCCallFunc * pTestCallFunc = CCCallFunc::create(this, (SEL_CallFunc)(&TestScene::callFunc));
CCRepeat * pTestRepeat = CCRepeat::create(CCSequence::createWithTwoActions(pTestDelayTime, pTestCallFunc), 2); << to 2 or 1 …

Cocos2d: TEST
Cocos2d: TEST

is it a bug?

PS: cocos2d-2.1rc0-x-2.1.2