Skip to content

Commit 5b78c5c

Browse files
committed
fixed wrong motion state constants in phaser p2 body
1 parent 22b472b commit 5b78c5c

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/physics/p2/Body.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,20 +1232,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", {
12321232

12331233
get: function () {
12341234

1235-
return (this.data.motionState === Phaser.Physics.P2.STATIC);
1235+
return (this.data.motionState === Phaser.Physics.P2.Body.STATIC);
12361236

12371237
},
12381238

12391239
set: function (value) {
12401240

1241-
if (value && this.data.motionState !== Phaser.Physics.P2.STATIC)
1241+
if (value && this.data.motionState !== Phaser.Physics.P2.Body.STATIC)
12421242
{
1243-
this.data.motionState = Phaser.Physics.P2.STATIC;
1243+
this.data.motionState = Phaser.Physics.P2.Body.STATIC;
12441244
this.mass = 0;
12451245
}
1246-
else if (!value && this.data.motionState === Phaser.Physics.P2.STATIC)
1246+
else if (!value && this.data.motionState === Phaser.Physics.P2.Body.STATIC)
12471247
{
1248-
this.data.motionState = Phaser.Physics.P2.DYNAMIC;
1248+
this.data.motionState = Phaser.Physics.P2.Body.DYNAMIC;
12491249

12501250
if (this.mass === 0)
12511251
{
@@ -1265,24 +1265,24 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", {
12651265

12661266
get: function () {
12671267

1268-
return (this.data.motionState === Phaser.Physics.P2.DYNAMIC);
1268+
return (this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC);
12691269

12701270
},
12711271

12721272
set: function (value) {
12731273

1274-
if (value && this.data.motionState !== Phaser.Physics.P2.DYNAMIC)
1274+
if (value && this.data.motionState !== Phaser.Physics.P2.Body.DYNAMIC)
12751275
{
1276-
this.data.motionState = Phaser.Physics.P2.DYNAMIC;
1276+
this.data.motionState = Phaser.Physics.P2.Body.DYNAMIC;
12771277

12781278
if (this.mass === 0)
12791279
{
12801280
this.mass = 1;
12811281
}
12821282
}
1283-
else if (!value && this.data.motionState === Phaser.Physics.P2.DYNAMIC)
1283+
else if (!value && this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC)
12841284
{
1285-
this.data.motionState = Phaser.Physics.P2.STATIC;
1285+
this.data.motionState = Phaser.Physics.P2.Body.STATIC;
12861286
this.mass = 0;
12871287
}
12881288

@@ -1298,20 +1298,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", {
12981298

12991299
get: function () {
13001300

1301-
return (this.data.motionState === Phaser.Physics.P2.KINEMATIC);
1301+
return (this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC);
13021302

13031303
},
13041304

13051305
set: function (value) {
13061306

1307-
if (value && this.data.motionState !== Phaser.Physics.P2.KINEMATIC)
1307+
if (value && this.data.motionState !== Phaser.Physics.P2.Body.KINEMATIC)
13081308
{
1309-
this.data.motionState = Phaser.Physics.P2.KINEMATIC;
1309+
this.data.motionState = Phaser.Physics.P2.Body.KINEMATIC;
13101310
this.mass = 4;
13111311
}
1312-
else if (!value && this.data.motionState === Phaser.Physics.P2.KINEMATIC)
1312+
else if (!value && this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC)
13131313
{
1314-
this.data.motionState = Phaser.Physics.P2.STATIC;
1314+
this.data.motionState = Phaser.Physics.P2.Body.STATIC;
13151315
this.mass = 0;
13161316
}
13171317

0 commit comments

Comments
 (0)