Arcade Physics Bodies didn't apply the results of allowRotation to the parent Game Object.

This commit is contained in:
Richard Davey 2018-02-27 01:08:55 +00:00
parent 7c96e93c47
commit 921d7e317a

View file

@ -852,29 +852,29 @@ var Body = new Class({
this.dirty = false;
if (this.deltaX() < 0)
this._dx = this.deltaX();
this._dy = this.deltaY();
if (this._dx < 0)
{
this.facing = CONST.FACING_LEFT;
}
else if (this.deltaX() > 0)
else if (this._dx > 0)
{
this.facing = CONST.FACING_RIGHT;
}
if (this.deltaY() < 0)
if (this._dy < 0)
{
this.facing = CONST.FACING_UP;
}
else if (this.deltaY() > 0)
else if (this._dy > 0)
{
this.facing = CONST.FACING_DOWN;
}
if (this.moves)
{
this._dx = this.deltaX();
this._dy = this.deltaY();
if (this.deltaMax.x !== 0 && this._dx !== 0)
{
if (this._dx < 0 && this._dx < -this.deltaMax.x)
@ -1002,6 +1002,8 @@ var Body = new Class({
{
if (center === undefined) { center = true; }
var gameObject = this.gameObject;
this.sourceWidth = width;
this.sourceHeight = height;
@ -1013,10 +1015,8 @@ var Body = new Class({
this.updateCenter();
if (center && this.gameObject.getCenter)
if (center && gameObject.getCenter)
{
var gameObject = this.gameObject;
var ox = gameObject.displayWidth / 2;
var oy = gameObject.displayHeight / 2;