al.an Posted March 11, 2021 Share Posted March 11, 2021 Hello everyone, I'd like to ask if anyone knows why it works like this. class Ship extends Phaser.Physics.Arcade.Sprite; class Meteor extends Phaser.Physics.Arcade.Sprite; class Meteors extends Phaser.Physics.Arcade.Group; this.physics.add.collider(this.meteors, this.ship, (meteor, ship) => { console.log(meteor instanceof Ship); // true console.log(ship instanceof Meteor); // true }); When meteor should be instance of Meteor and ship of Ship given the order of arguments. Link to comment Share on other sites More sharing options...
Recommended Posts