pausable p2 world

This commit is contained in:
Georgios Kaleadis 2014-04-24 11:56:52 +02:00
parent 387ff4f0fa
commit 339da73160

View file

@ -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)
{