If I stack many sprites on top of each other, they start overlapping, and meld into each other.
To reproduce, paste the following here: https://labs.phaser.io/edit.html?src=src/physics/arcade/simple%20group.js&v=3.24.1
var config = {
type: Phaser.AUTO,
width: 800,
height: 800,
parent: 'phaser-example',
physics: {
default: 'arcade',
arcade: {
debug: true,
gravity: { y: 200 }
}
},
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload ()
{
this.load.image('block', 'assets/sprites/block.png');
}
function create ()
{
var group = this.physics.add.group({
bounceX: 1,
mass: 20,
// bounceY: 1,
collideWorldBounds: true
});
var block1 = group.create(300, 650, 'block').setVelocity(0, 0);
var block1 = group.create(300, 450, 'block').setVelocity(0, 0);
var block2 = group.create(300, 300, 'block').setVelocity(0, 0);
var block3 = group.create(300, 150, 'block').setVelocity(0, 0);
var block4 = group.create(300, 0, 'block').setVelocity(0, 0);
this.physics.add.collider(group, group);
}
(in my usecase, there are quite a few more boxes)
Is arcade physics just not suitable for such thing? Or Is there some setting which would help?