Skip to content

Commit 5e11b1a

Browse files
committed
The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes phaserjs#563)
1 parent 1746afe commit 5e11b1a

5 files changed

Lines changed: 53 additions & 20 deletions

File tree

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
![Phaser 2.0](http://www.phaser.io/images/phaser2-github.png)
22

3-
Phaser 2.0.0
3+
Phaser 2.0.1
44
============
55

66
Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering.
77

8-
Version: 2.0.0 "Aes Sedai" - Released: March 13th 2014
8+
Version: 2.0.1 "Aes Sedai" - Released: -in development-
99

1010
By Richard Davey, [Photon Storm](http://www.photonstorm.com)
1111

@@ -53,6 +53,15 @@ There is also an [un-official Getting Started Guide](http://www.antonoffplus.com
5353
Change Log
5454
----------
5555

56+
Version 2.0.1 - "Aes Sedai" - -in development-
57+
58+
Bug Fixes
59+
60+
* The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563)
61+
62+
63+
64+
5665
Version 2.0.0 - "Aes Sedai" - March 13th 2014
5766

5867
There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available. In the guide we detail the API breaking changes and approach to our new physics system. The following is a list of all the other new features, updates and bug fixes present in this release.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phaser",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"homepage": "http://phaser.io",
55
"authors": [
66
"photonstorm <rich@photonstorm.com>"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Phaser",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"release": "Aes Sedai",
55
"description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.",
66
"author": "Richard Davey",

src/Phaser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
var Phaser = Phaser || {
1111

1212
VERSION: '<%= version %>',
13-
DEV_VERSION: '2.0.0',
13+
DEV_VERSION: '2.0.1',
1414
GAMES: [],
1515

1616
AUTO: 0,

src/physics/p2/Body.js

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,30 @@ Phaser.Physics.P2.Body.prototype = {
11971197

11981198
Phaser.Physics.P2.Body.prototype.constructor = Phaser.Physics.P2.Body;
11991199

1200+
/**
1201+
* Dynamic body.
1202+
* @property DYNAMIC
1203+
* @type {Number}
1204+
* @static
1205+
*/
1206+
Phaser.Physics.P2.Body.DYNAMIC = 1;
1207+
1208+
/**
1209+
* Static body.
1210+
* @property STATIC
1211+
* @type {Number}
1212+
* @static
1213+
*/
1214+
Phaser.Physics.P2.Body.STATIC = 2;
1215+
1216+
/**
1217+
* Kinematic body.
1218+
* @property KINEMATIC
1219+
* @type {Number}
1220+
* @static
1221+
*/
1222+
Phaser.Physics.P2.Body.KINEMATIC = 4;
1223+
12001224
/**
12011225
* @name Phaser.Physics.P2.Body#static
12021226
* @property {boolean} static - Returns true if the Body is static. Setting Body.static to 'false' will make it dynamic.
@@ -1205,20 +1229,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", {
12051229

12061230
get: function () {
12071231

1208-
return (this.data.motionState === Phaser.STATIC);
1232+
return (this.data.motionState === Phaser.Physics.P2.STATIC);
12091233

12101234
},
12111235

12121236
set: function (value) {
12131237

1214-
if (value && this.data.motionState !== Phaser.STATIC)
1238+
if (value && this.data.motionState !== Phaser.Physics.P2.STATIC)
12151239
{
1216-
this.data.motionState = Phaser.STATIC;
1240+
this.data.motionState = Phaser.Physics.P2.STATIC;
12171241
this.mass = 0;
12181242
}
1219-
else if (!value && this.data.motionState === Phaser.STATIC)
1243+
else if (!value && this.data.motionState === Phaser.Physics.P2.STATIC)
12201244
{
1221-
this.data.motionState = Phaser.DYNAMIC;
1245+
this.data.motionState = Phaser.Physics.P2.DYNAMIC;
12221246

12231247
if (this.mass === 0)
12241248
{
@@ -1238,24 +1262,24 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", {
12381262

12391263
get: function () {
12401264

1241-
return (this.data.motionState === Phaser.DYNAMIC);
1265+
return (this.data.motionState === Phaser.Physics.P2.DYNAMIC);
12421266

12431267
},
12441268

12451269
set: function (value) {
12461270

1247-
if (value && this.data.motionState !== Phaser.DYNAMIC)
1271+
if (value && this.data.motionState !== Phaser.Physics.P2.DYNAMIC)
12481272
{
1249-
this.data.motionState = Phaser.DYNAMIC;
1273+
this.data.motionState = Phaser.Physics.P2.DYNAMIC;
12501274

12511275
if (this.mass === 0)
12521276
{
12531277
this.mass = 1;
12541278
}
12551279
}
1256-
else if (!value && this.data.motionState === Phaser.DYNAMIC)
1280+
else if (!value && this.data.motionState === Phaser.Physics.P2.DYNAMIC)
12571281
{
1258-
this.data.motionState = Phaser.STATIC;
1282+
this.data.motionState = Phaser.Physics.P2.STATIC;
12591283
this.mass = 0;
12601284
}
12611285

@@ -1271,20 +1295,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", {
12711295

12721296
get: function () {
12731297

1274-
return (this.data.motionState === Phaser.KINEMATIC);
1298+
return (this.data.motionState === Phaser.Physics.P2.KINEMATIC);
12751299

12761300
},
12771301

12781302
set: function (value) {
12791303

1280-
if (value && this.data.motionState !== Phaser.KINEMATIC)
1304+
if (value && this.data.motionState !== Phaser.Physics.P2.KINEMATIC)
12811305
{
1282-
this.data.motionState = Phaser.KINEMATIC;
1306+
this.data.motionState = Phaser.Physics.P2.KINEMATIC;
12831307
this.mass = 4;
12841308
}
1285-
else if (!value && this.data.motionState === Phaser.KINEMATIC)
1309+
else if (!value && this.data.motionState === Phaser.Physics.P2.KINEMATIC)
12861310
{
1287-
this.data.motionState = Phaser.STATIC;
1311+
this.data.motionState = Phaser.Physics.P2.STATIC;
12881312
this.mass = 0;
12891313
}
12901314

0 commit comments

Comments
 (0)