Box2D simple project doesnt works

Box2D simple project doesnt works
0.0 0



Im creating a simple project but nothing happen with image. Instead of the imagego down, it is stopped on center screen.



Hi Paulo,

I have created a new Box2d project with cocos2d-2.0-x-2.0.3 version. This project is running correctly. Please compare your HelloWorld.h and HelloWorld.cpp with HelloWorldScene.cpp and HelloWorldScene.h, I think this can help you to find the problem.

I hope you find it useful


In your update method for the world. You are taking the sprites coordinates, and forcing the body to them, instead of taking the body’s position and rotation, and setting the sprite accordingly.

So what you want to do, is get the body / fixture information, then set your entity variable rotation, x, and y according to that.