Jump to content

Physics collider wrong objects order


al.an
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...