mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Arcade Physics Bodies didn't apply the results of allowRotation
to the parent Game Object.
This commit is contained in:
parent
7c96e93c47
commit
921d7e317a
1 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue