Skip to content

Commit

Permalink
pausable p2 world
Browse files Browse the repository at this point in the history
  • Loading branch information
georgiee committed Apr 24, 2014
1 parent 387ff4f commit 339da73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/physics/p2/World.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,28 @@ Phaser.Physics.P2.prototype = {

},

/**
* @method Phaser.Physics.P2#update
*/
pause: function() {
this.paused = true
},

/**
* @method Phaser.Physics.P2#update
*/
resume: function() {
this.paused = false
},

/**
* @method Phaser.Physics.P2#update
*/
update: function () {
// do nothing when the pysics engine was paused before
if (this.paused){
return
}

if (this.useElapsedTime)
{
Expand Down

0 comments on commit 339da73

Please sign in to comment.