Skip to content

Commit

Permalink
The Static, Kinematic and Dynamic consts that P2.Body uses were incor…
Browse files Browse the repository at this point in the history
…rect (fixes phaserjs#563)
  • Loading branch information
photonstorm committed Mar 14, 2014
1 parent 1746afe commit 5e11b1a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 20 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
![Phaser 2.0](http://www.phaser.io/images/phaser2-github.png)

Phaser 2.0.0
Phaser 2.0.1
============

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.

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

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

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

Version 2.0.1 - "Aes Sedai" - -in development-

Bug Fixes

* The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563)




Version 2.0.0 - "Aes Sedai" - March 13th 2014

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.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phaser",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "http://phaser.io",
"authors": [
"photonstorm <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Phaser",
"version": "2.0.0",
"version": "2.0.1",
"release": "Aes Sedai",
"description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.",
"author": "Richard Davey",
Expand Down
2 changes: 1 addition & 1 deletion src/Phaser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var Phaser = Phaser || {

VERSION: '<%= version %>',
DEV_VERSION: '2.0.0',
DEV_VERSION: '2.0.1',
GAMES: [],

AUTO: 0,
Expand Down
54 changes: 39 additions & 15 deletions src/physics/p2/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,30 @@ Phaser.Physics.P2.Body.prototype = {

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

/**
* Dynamic body.
* @property DYNAMIC
* @type {Number}
* @static
*/
Phaser.Physics.P2.Body.DYNAMIC = 1;

/**
* Static body.
* @property STATIC
* @type {Number}
* @static
*/
Phaser.Physics.P2.Body.STATIC = 2;

/**
* Kinematic body.
* @property KINEMATIC
* @type {Number}
* @static
*/
Phaser.Physics.P2.Body.KINEMATIC = 4;

/**
* @name Phaser.Physics.P2.Body#static
* @property {boolean} static - Returns true if the Body is static. Setting Body.static to 'false' will make it dynamic.
Expand All @@ -1205,20 +1229,20 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", {

get: function () {

return (this.data.motionState === Phaser.STATIC);
return (this.data.motionState === Phaser.Physics.P2.STATIC);

},

set: function (value) {

if (value && this.data.motionState !== Phaser.STATIC)
if (value && this.data.motionState !== Phaser.Physics.P2.STATIC)
{
this.data.motionState = Phaser.STATIC;
this.data.motionState = Phaser.Physics.P2.STATIC;
this.mass = 0;
}
else if (!value && this.data.motionState === Phaser.STATIC)
else if (!value && this.data.motionState === Phaser.Physics.P2.STATIC)
{
this.data.motionState = Phaser.DYNAMIC;
this.data.motionState = Phaser.Physics.P2.DYNAMIC;

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

get: function () {

return (this.data.motionState === Phaser.DYNAMIC);
return (this.data.motionState === Phaser.Physics.P2.DYNAMIC);

},

set: function (value) {

if (value && this.data.motionState !== Phaser.DYNAMIC)
if (value && this.data.motionState !== Phaser.Physics.P2.DYNAMIC)
{
this.data.motionState = Phaser.DYNAMIC;
this.data.motionState = Phaser.Physics.P2.DYNAMIC;

if (this.mass === 0)
{
this.mass = 1;
}
}
else if (!value && this.data.motionState === Phaser.DYNAMIC)
else if (!value && this.data.motionState === Phaser.Physics.P2.DYNAMIC)
{
this.data.motionState = Phaser.STATIC;
this.data.motionState = Phaser.Physics.P2.STATIC;
this.mass = 0;
}

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

get: function () {

return (this.data.motionState === Phaser.KINEMATIC);
return (this.data.motionState === Phaser.Physics.P2.KINEMATIC);

},

set: function (value) {

if (value && this.data.motionState !== Phaser.KINEMATIC)
if (value && this.data.motionState !== Phaser.Physics.P2.KINEMATIC)
{
this.data.motionState = Phaser.KINEMATIC;
this.data.motionState = Phaser.Physics.P2.KINEMATIC;
this.mass = 4;
}
else if (!value && this.data.motionState === Phaser.KINEMATIC)
else if (!value && this.data.motionState === Phaser.Physics.P2.KINEMATIC)
{
this.data.motionState = Phaser.STATIC;
this.data.motionState = Phaser.Physics.P2.STATIC;
this.mass = 0;
}

Expand Down

0 comments on commit 5e11b1a

Please sign in to comment.