# Collision detection

**URL:** <https://phaser.discourse.group/t/collision-detection/9819>\
**Category:** Phaser 3\
**Created:** [June 21, 2021, 8:46am UTC](https://phaser.discourse.group/t/collision-detection/9819 "2021-06-21T08:46:38Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [June 28, 2021, 9:30pm UTC](https://phaser.discourse.group/t/collision-detection/9819/21 "2021-06-28T21:30:00Z")

</div>

That’s the “missing texture” texture. You tried to use a texture key that doesn’t exist, for whatever game object is there.

---

<div class="post-metadata">

**Author:** ![Keerti\_Jain](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/keerti_jain/32/5313_2.png) [@Keerti\_Jain](https://phaser.discourse.group/u/Keerti_Jain)\
**Post date:** [June 29, 2021, 2:04am UTC](https://phaser.discourse.group/t/collision-detection/9819/22 "2021-06-29T02:04:31Z")

</div>

There is not object there

---

<div class="post-metadata">

**Author:** ![Keerti\_Jain](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/keerti_jain/32/5313_2.png) [@Keerti\_Jain](https://phaser.discourse.group/u/Keerti_Jain)\
**Post date:** [June 29, 2021, 2:23am UTC](https://phaser.discourse.group/t/collision-detection/9819/23 "2021-06-29T02:23:13Z")

</div>

here is the code

```javascript
function preload() {
  //load game images
  this.load.image('background', './assets/board_carrom.png');
  // this.load.image('cannon','./assets/cannon.png');
  this.load.image('strickerball', './assets/stricker.png');
  this.load.image('pirateShipblack', './assets/blackcoin.png');
  this.load.image('pirateShipwhite', './assets/whitecoin.png');
  this.load.image('pirateShipred', './assets/redcoin.png');
}

function create() {
  //for mouse click event
  mouse = this.input.mousePointer;
  //for mouse position
  input = this.input;
  console.log(input);
  //set game bounds
  worldBounds = this.physics.world.bounds;
  /* worldBounds.x=60;
  worldBounds.y=60;
  worldBounds.width=380;
  worldBounds.height=380;
  */
  this.physics.world.bounds.setTo(60, 60, 380, 380);

  //Create image using setOrigin
  this.add.image(0, 0, 'background').setOrigin(0, 0);
  strickerball = this.physics.add.sprite(137, 380, 'strickerball');
  strickerball.setCollideWorldBounds(true);
  strickerball.setDamping(false);
  strickerball.setDragX(0.9);
  strickerball.setDragY(0.9);
  strickerball.setBounceX(Phaser.Math.FloatBetween(0.4, 0.8));
  strickerball.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8));
  //create pirate ship
  pirateship = this.physics.add.group({ key: 'coins', collideWorldBounds: true });
  pirateship.create(254, 250, 'pirateShipred');
  pirateship.create(265, 241, 'pirateShipwhite');
  pirateship.create(247, 237, 'pirateShipblack');
  pirateship.create(238, 248, 'pirateShipwhite');
  pirateship.create(244, 260, 'pirateShipblack');
  pirateship.create(261, 264, 'pirateShipwhite');
  pirateship.create(270, 253, 'pirateShipblack');

  //second round

  pirateship.create(249, 275, 'pirateShipblack');
  pirateship.create(265, 278, 'pirateShipwhite');
  pirateship.create(275, 267, 'pirateShipblack');
  pirateship.create(285, 256, 'pirateShipwhite');
  pirateship.create(279, 241, 'pirateShipblack');
  pirateship.create(267, 228, 'pirateShipwhite');
  pirateship.create(253, 223, 'pirateShipblack');
  pirateship.create(237, 226, 'pirateShipwhite');
  pirateship.create(230, 232, 'pirateShipblack');
  pirateship.create(224, 242, 'pirateShipwhite');
  pirateship.create(225, 257, 'pirateShipblack');
  pirateship.create(233, 270, 'pirateShipwhite');

  pirateship.children.iterate(function (child) {
    child.setDamping(false);
    child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8));
    child.setBounceX(Phaser.Math.FloatBetween(0.4, 0.8));
    child.setDragX(0.99);
    child.setDragY(0.99);
  });
}

```

---

<div class="post-metadata">

**Author:** ![Keerti\_Jain](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/keerti_jain/32/5313_2.png) [@Keerti\_Jain](https://phaser.discourse.group/u/Keerti_Jain)\
**Post date:** [July 6, 2021, 4:15pm UTC](https://phaser.discourse.group/t/collision-detection/9819/24 "2021-07-06T16:15:29Z")

</div>

Hi,

I have a problem of placing the striker for other player.While placing stricker for other player the stricker collides with all coins in between.

---

<div class="post-metadata">

**Author:** ![Keerti\_Jain](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/keerti_jain/32/5313_2.png) [@Keerti\_Jain](https://phaser.discourse.group/u/Keerti_Jain)\
**Post date:** [July 9, 2021, 5:23pm UTC](https://phaser.discourse.group/t/collision-detection/9819/25 "2021-07-09T17:23:40Z")

</div>

Hi,

Can anyone help me to rotate the coins of carrom to 180 degrees and place coin after 180

[Previous page](https://phaser.discourse.group/t/collision-detection/9819.md?page=1)
