Cocos2d-X v3.x : Calling Functions after Delay
I had been facing some issue with calling functions after some delay. So there have been syntax changes happening in cocos2dx, because of which it was a bit difficult to find out which one was the correct approach. I finally got the below sequence to work: float delay = 2.0f; auto delayAction = DelayTime ::create(delay); // For 2 Seconds of Delay auto funcCallback = CallFunc ::create([](){ // Add Your Code Here! // If you want, you can call other functions from here as well }); this ->runAction( Sequence ::create(delayAction, funcCallback, NULL )); Though initially I didn't like integrating a function within the code (known as lambda function), I realised this made life simpler by removing cumbersome selector calls, where you had to remember separate calls based on what kinds of arguments need to be passed. ...