I'm using AndEngine and Box2d in android application.
What to I have to do so that when player and coin collide, the player goes through coin without hitting against it as if it is a wall?
public class GameScene extends Scene {
GameScene() {
Body playerBody = PhysicsFactory.createBoxBody(world, playerSprite, BodyType.DynamicBody, fixtureDef);
PhysicsConnector playerConnector = new PhysicsConnector(playerSprite, playerBody, true, false);
world.registerPhysicsConnector(playerConnector);
Body coinBody = PhysicsFactory.createBoxBody(world, coinSprite, BodyType.StaticBody, fixtureDef);
PhysicsConnector coinConnector = new PhysicsConnector(coinSprite, coinBody, true, false);
world.registerPhysicsConnector(coinConnector);
}
private ContactListener createContactListener(){
//if player and coin collide --> destroy coin
}
}