So I am working on a 2D basketball game. I am using 2 small sprites (with circular physics bodies) on each side of the basket rim for collision detection with the ball. I parented the 2 sprites to the backboard so I could move them all together (as shown in the child sprite example). I turned on the debug draw for the physics bodies and found the 2 bodies were not in the same position as the sprites.
//Load net sprite
this.net = this.game.add.sprite(this.game.world.centerX, 200, 'net');
//Add hoop children markers
this.leftMarker = this.net.addChild(this.game.make.sprite(-66, 60, 'marker'));
this.rightMarker = this.net.addChild(this.game.make.sprite(66, 60, 'marker'));
I parent them like so.. but my physics bodies don't act as if they are parented. They should be at the same position as the sprite, but instead they are (-66, 60) and (66, 60) from the top left corner (0, 0) instead of (-66, 60) and (66, 60) from the parents position (world center x, 200). You can see the attached image as an example.
Is there something I am missing? Is this the way it's supposed to be? Can I somehow update the physics bodies to line up with the sprites easily?