mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
pausable p2 world
This commit is contained in:
parent
387ff4f0fa
commit
339da73160
1 changed files with 18 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue