Currently I’m experimenting with Cocos2d-x and Box2d. I found a problem concerning the priority of Action Manager in relation to other sub-systems.
I’ve got the main layer which has the ‘update’ method, which in turn invokes PhysicsSystem::Update. Some physical nodes should shake on collision with each other. This is done via actions. But it appears that actions are performed at the very beginning of each frame, before any other scheduled functions. Thus each frame I shake the nodes and then call PhysicsSystem::Update which naturally overwrites the transformations done by actions.
Now here are two questions:
- Why the heck actions have the highest priority? Isn’t it conceptually wrong? Why aren’t actions performed after all scheduled functions?
- How to fix this issue without hacking Cocos2dx, since it can open Pandora’s box and cause new problems?