Skip to content

Commit 921d7e3

Browse files
committed
Arcade Physics Bodies didn't apply the results of allowRotation to the parent Game Object.
1 parent 7c96e93 commit 921d7e3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/physics/arcade/Body.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -852,29 +852,29 @@ var Body = new Class({
852852

853853
this.dirty = false;
854854

855-
if (this.deltaX() < 0)
855+
this._dx = this.deltaX();
856+
this._dy = this.deltaY();
857+
858+
if (this._dx < 0)
856859
{
857860
this.facing = CONST.FACING_LEFT;
858861
}
859-
else if (this.deltaX() > 0)
862+
else if (this._dx > 0)
860863
{
861864
this.facing = CONST.FACING_RIGHT;
862865
}
863866

864-
if (this.deltaY() < 0)
867+
if (this._dy < 0)
865868
{
866869
this.facing = CONST.FACING_UP;
867870
}
868-
else if (this.deltaY() > 0)
871+
else if (this._dy > 0)
869872
{
870873
this.facing = CONST.FACING_DOWN;
871874
}
872875

873876
if (this.moves)
874877
{
875-
this._dx = this.deltaX();
876-
this._dy = this.deltaY();
877-
878878
if (this.deltaMax.x !== 0 && this._dx !== 0)
879879
{
880880
if (this._dx < 0 && this._dx < -this.deltaMax.x)
@@ -1002,6 +1002,8 @@ var Body = new Class({
10021002
{
10031003
if (center === undefined) { center = true; }
10041004

1005+
var gameObject = this.gameObject;
1006+
10051007
this.sourceWidth = width;
10061008
this.sourceHeight = height;
10071009

@@ -1013,10 +1015,8 @@ var Body = new Class({
10131015

10141016
this.updateCenter();
10151017

1016-
if (center && this.gameObject.getCenter)
1018+
if (center && gameObject.getCenter)
10171019
{
1018-
var gameObject = this.gameObject;
1019-
10201020
var ox = gameObject.displayWidth / 2;
10211021
var oy = gameObject.displayHeight / 2;
10221022

0 commit comments

Comments
 (0)