I am fairly new to cocos2d and box2d. I am attempting to create a game horizontal endless runner using the accelerometer. I have the character falling from the top and is constantly moving downwards. The problem that i am running into is that overtime the sprite and the physics body become out of sync and the physics body moves away from the sprite thus causing wierd behavior with the collision. This only happens when ran on the device, because the player is constantly moving down, the collision is becoming out of sync vertically and the horizontal remains correct. My step function is :
const float32 timeStep = 1.0f / 30.0f;
const int32 velocityIterations = 5;
const int32 positionIterations = 1;
// step the world
world->Step(timeStep, velocityIterations, positionIterations);