Jump to content

Physics collider wrong objects order


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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