Jump to content

AfternoonWolf

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by AfternoonWolf

  1. You can add the collision event callback to the object itself. var paddle = this.matter.add.image(400, 550, 'assets', 'paddle.png'); var paddle.setOnCollide(pair => { // pair.bodyA // pair.bodyB }); See the documentation under enableCollisionEventsPlugin(): https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Matter.MatterPhysics.html and also what a pair looks like: https://brm.io/matter-js/docs/files/src_collision_Pair.js.html# You can also listen for specific collisions. var paddle.setOnCollideWith(ball, pair => { // Do something });
×
×
  • Create New...