I’m curious if there is a better way to wait for some animation to finish than using callbacks. Coroutines would do this but I can’t find a standard implementation in C++. The inability to tap into cocos2dx main loop makes writing my own blocking event dispatch difficult as well. How do people do this in cocos2dx? Callbacks will do except that I have a ton of code to run, which waits on some other animation and then calls something else. I’d rather not have a callback hell. Thanks.

Too bad there are quite a few issues with Boost.Coroutine. It’s not yet officially released and has bad cross compiler support. One of its own test cases, test_unwind, fails when built with clang(works fine in gcc-4.6 though). Looks like I’m stuck .

Too bad this only works for animation sequence, not abitrary code. A lot of my delayed actions are actually calculations and if I go the callback action style I’ll have a gazillion callbacks, or just tons of lambdas scattered all over place… Just wrote my own coroutine system today and will share it if it works smoothly in production.