ios - Movement of Box2d Body in cocos2d-x -
I need to move the Box 2D body according to the available Farm Game Center server.
After getting the position, I update the condition of the body using the bus: -
carbie-> set transformer (B2 VC2 (serverposition.x, Serverpace.i), 0); But running her body inappropriately (for example, the body appears to somehow on the screen). At this time my phantom image does not move (attached to the body)
I resolve the situation What I've done I've taken a normal phantom image and just changed the situation in the update, with that box 2D body position.
Example: -
Your carrier movement based on the state of the server. It will move forward invisibly without user data (image), your B2UD
caramenboed-> setransform (B2VC2 (serverposition, Carmenboode-> gtposition). 0.0 F); Here's your normal phantom image. Just touch your phantom image like << p>
car-> setposition (CCP (Carmenby-> Gatepage (). X * PTM_RATIO, CarmenBode-> Gateposition (). Y * PTM_RATIO); This method worked well for me.
Comments
Post a Comment