mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
fixed wrong motion state constants in phaser p2 body
This commit is contained in:
parent
22b472ba4d
commit
5b78c5c46e
1 changed files with 15 additions and 15 deletions
|
@ -1232,20 +1232,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return (this.data.motionState === Phaser.Physics.P2.STATIC);
|
||||
return (this.data.motionState === Phaser.Physics.P2.Body.STATIC);
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
if (value && this.data.motionState !== Phaser.Physics.P2.STATIC)
|
||||
if (value && this.data.motionState !== Phaser.Physics.P2.Body.STATIC)
|
||||
{
|
||||
this.data.motionState = Phaser.Physics.P2.STATIC;
|
||||
this.data.motionState = Phaser.Physics.P2.Body.STATIC;
|
||||
this.mass = 0;
|
||||
}
|
||||
else if (!value && this.data.motionState === Phaser.Physics.P2.STATIC)
|
||||
else if (!value && this.data.motionState === Phaser.Physics.P2.Body.STATIC)
|
||||
{
|
||||
this.data.motionState = Phaser.Physics.P2.DYNAMIC;
|
||||
this.data.motionState = Phaser.Physics.P2.Body.DYNAMIC;
|
||||
|
||||
if (this.mass === 0)
|
||||
{
|
||||
|
@ -1265,24 +1265,24 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return (this.data.motionState === Phaser.Physics.P2.DYNAMIC);
|
||||
return (this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC);
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
if (value && this.data.motionState !== Phaser.Physics.P2.DYNAMIC)
|
||||
if (value && this.data.motionState !== Phaser.Physics.P2.Body.DYNAMIC)
|
||||
{
|
||||
this.data.motionState = Phaser.Physics.P2.DYNAMIC;
|
||||
this.data.motionState = Phaser.Physics.P2.Body.DYNAMIC;
|
||||
|
||||
if (this.mass === 0)
|
||||
{
|
||||
this.mass = 1;
|
||||
}
|
||||
}
|
||||
else if (!value && this.data.motionState === Phaser.Physics.P2.DYNAMIC)
|
||||
else if (!value && this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC)
|
||||
{
|
||||
this.data.motionState = Phaser.Physics.P2.STATIC;
|
||||
this.data.motionState = Phaser.Physics.P2.Body.STATIC;
|
||||
this.mass = 0;
|
||||
}
|
||||
|
||||
|
@ -1298,20 +1298,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return (this.data.motionState === Phaser.Physics.P2.KINEMATIC);
|
||||
return (this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC);
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
if (value && this.data.motionState !== Phaser.Physics.P2.KINEMATIC)
|
||||
if (value && this.data.motionState !== Phaser.Physics.P2.Body.KINEMATIC)
|
||||
{
|
||||
this.data.motionState = Phaser.Physics.P2.KINEMATIC;
|
||||
this.data.motionState = Phaser.Physics.P2.Body.KINEMATIC;
|
||||
this.mass = 4;
|
||||
}
|
||||
else if (!value && this.data.motionState === Phaser.Physics.P2.KINEMATIC)
|
||||
else if (!value && this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC)
|
||||
{
|
||||
this.data.motionState = Phaser.Physics.P2.STATIC;
|
||||
this.data.motionState = Phaser.Physics.P2.Body.STATIC;
|
||||
this.mass = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue