# Check collision / overlap between sprites without Physics

**URL:** <https://phaser.discourse.group/t/check-collision-overlap-between-sprites-without-physics/6696>\
**Category:** Phaser 3\
**Created:** [June 16, 2020, 4:36pm UTC](https://phaser.discourse.group/t/check-collision-overlap-between-sprites-without-physics/6696 "2020-06-16T16:36:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Soeparjo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/william_soeparjo/32/1406_2.png) [@William\_Soeparjo](https://phaser.discourse.group/u/William_Soeparjo)\
**Post date:** [June 16, 2020, 4:36pm UTC](https://phaser.discourse.group/t/check-collision-overlap-between-sprites-without-physics/6696/1 "2020-06-16T16:36:35Z")

</div>

I have 2 objects.

Each object have x,y position and size (width, height).

How can i detect an collision or overlap between 2 sprites based on these parameter ?

Thanks

---

<div class="post-metadata">

**Author:** ![ghclark2](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@ghclark2](https://phaser.discourse.group/u/ghclark2)\
**Post date:** [June 16, 2020, 5:31pm UTC](https://phaser.discourse.group/t/check-collision-overlap-between-sprites-without-physics/6696/2 "2020-06-16T17:31:22Z")

</div>

You can use the static method Phaser.Geom.Intersects.RectangleToRectangle(sprite1, sprite2) which returns a boolean in your scene’s update method.

[https://photonstorm.github.io/phaser3-docs/Phaser.Geom.Intersects.html](https://photonstorm.github.io/phaser3-docs/Phaser.Geom.Intersects.html)

---

<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 16, 2020, 5:56pm UTC](https://phaser.discourse.group/t/check-collision-overlap-between-sprites-without-physics/6696/3 "2020-06-16T17:56:36Z")

</div>

You can use the Geom methods directly only if the game objects have origin (0, 0).

---

<div class="post-metadata">

**Author:** ![William\_Soeparjo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/william_soeparjo/32/1406_2.png) [@William\_Soeparjo](https://phaser.discourse.group/u/William_Soeparjo)\
**Post date:** [June 17, 2020, 1:34am UTC](https://phaser.discourse.group/t/check-collision-overlap-between-sprites-without-physics/6696/4 "2020-06-17T01:34:58Z")

</div>

Working code

```
function checkOverlap(spriteA, spriteB) {
	    var boundsA = spriteA.getBounds();
	    var boundsB = spriteB.getBounds();
	    return Phaser.Geom.Intersects.RectangleToRectangle(boundsA, boundsB);
	}
```
