I’m having a problem handling when objects push past each other with collisions on.
This is the code I edited the ClownExample clown# 2 just runs through clown #1.
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'phaser-example',
physics: {
default: 'arcade',
arcade: { debug: true }
},
scene: {
preload: preload,
create: create
}
};
new Phaser.Game(config);
function preload ()
{
this.load.image('block', 'assets/sprites/block.png');
this.load.image('clown', 'assets/sprites/clown.png');
}
function create ()
{
var block = this.physics.add.staticImage(600, 300, 'block');
var clowns = this.physics.add.group();
clowns.create(200, 300, 'clown').setVelocityX(100);
clowns.create(150, 300, 'clown').setVelocityX(300);
this.physics.add.collider(clowns)
this.physics.add.collider(clowns,block)
}