Skip to content

Commit 11b0436

Browse files
committed
Fixed Arcade Physics Circle body collision, after the phaserjs#2654 change broke it unintentionally.
1 parent 92fc280 commit 11b0436

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/physics/arcade/World.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,10 @@ Phaser.Physics.Arcade.prototype = {
11581158
this.getOverlapX(body1, body2);
11591159
this.getOverlapY(body1, body2);
11601160

1161-
var angleCollision = this.angleBetweenCenters(body1, body2);
1161+
var dx = body2.center.x - body1.center.x;
1162+
var dy = body2.center.y - body1.center.y;
1163+
1164+
var angleCollision = Math.atan2(dy, dx);
11621165

11631166
var overlap = 0;
11641167

0 commit comments

Comments
 (0)