Skip to content

Commit 08aa381

Browse files
committed
p2 object re-created on system start.
1 parent a8502f3 commit 08aa381

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/physics/Physics.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ Phaser.Physics.prototype = {
131131
*/
132132
startSystem: function (system) {
133133

134-
if (system === Phaser.Physics.ARCADE && this.arcade === null)
134+
if (system === Phaser.Physics.ARCADE)
135135
{
136136
this.arcade = new Phaser.Physics.Arcade(this.game);
137137
}
138-
else if (system === Phaser.Physics.P2JS && this.p2 === null)
138+
else if (system === Phaser.Physics.P2JS)
139139
{
140140
this.p2 = new Phaser.Physics.P2(this.game, this.config);
141141
}
142-
if (system === Phaser.Physics.NINJA && this.ninja === null)
142+
if (system === Phaser.Physics.NINJA)
143143
{
144144
this.ninja = new Phaser.Physics.Ninja(this.game);
145145
}

src/physics/p2/World.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,9 @@ Phaser.Physics.P2.prototype = {
662662
this.world.off("beginContact", this.beginContactHandler, this);
663663
this.world.off("endContact", this.endContactHandler, this);
664664

665-
this.setPostBroadphaseCallback(null);
666-
this.setImpactEvents(null);
665+
this.postBroadphaseCallback = null;
666+
this.callbackContext = null;
667+
this.impactCallback = null;
667668

668669
this.collisionGroups = [];
669670
this._toRemove = [];

0 commit comments

Comments
 (0)