There is a class called CCScheduler which can handle an “update” function as in XNA.
In your main scene, at the end of your init function, if you put:
This will schedule the function MainScene::update to be called every frame (0 is the default for calling every frame)
The prototype for MainScene::update is as follows:
void MainScene::update(float dt)
You can see this method been used in this example:
http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter\_5*-*How\_to\_Detect\_the\_Collisionswith the slight correction that in that example, the prototype is wrong and should be as above in the latest version