How to collide group with itself and each children push back the other

Hi,
i want to create two or more sprite maybe at the same location with arcade physics and i want that each member push back the other… i try without success.

I made a jsffidle about that :

https://jsfiddle.net/espace3d/1nps402y/

var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    backgroundColor: '#1b1464',
    parent: 'phaser-example',
    physics: {
        default: 'arcade',
        arcade: {
            gravity: {
                x: 0,
                y: 100,
            },
        debug:true,
        }
    },
    scene: {
        preload: preload,
        create: create,
        update: update

    }
};

var game = new Phaser.Game(config);
var o={};
function preload ()
{
	this.load.image("block", "https://i.postimg.cc/KvY7DVGx/player.png");
}

function create ()
{
o.g = this.physics.add.group()

o.e = this.physics.add.sprite(100,100,"block").setBounce(1,1)
o.f = this.physics.add.sprite(140,120,"block").setBounce(1,1)

o.g.add(o.e)
o.g.add(o.f)
this.physics.add.collider(o.g, o.g);

}
function update ()
{
 
}

Could you help me please ?
Thanks.

Hi,
Sprites bodies can’t collides if they already overlaps, so you can’t start at the same position at the same time. Here’s a working example:

var game = new Phaser.Game(config);

function preload ()
{
	this.load.image("block", "https://i.postimg.cc/KvY7DVGx/player.png");
}

function create ()
{
this.g = []

this.e = this.physics.add.sprite(100,100,"block").setBounce(1,1)
this.f = this.physics.add.sprite(140,200,"block").setBounce(1,1)

this.e.body.setCollideWorldBounds(true)
this.f.body.setCollideWorldBounds(true)

this.g.push(this.e)
this.g.push(this.f)
this.physics.add.collider(this.g, this.g);

}
function update ()
{
 
}