How to make the physical model repeat the movement for the sprite?
Link to the video where the problem is clearly shown:
P.S. The code is in standard patterns called - AnchorPoints
Jump to content
Physics objects don't really play nice with display groups.
You are experiencing that issue because you are adjusting the display object's anchor point after it has been created. The physics body doesn't respond to changes in the anchor point after it has been created.
All you need to do is destroy the physics body before you change the anchor and then recreate it. Add the following lines of code to lines 50 and 60 and it'll work:
physics.removeBody( logo ) -- line 50
physics.addBody( logo ) -- line 60