mirror of
https://github.com/wassname/phaser.git
synced 2026-07-12 00:50:45 +08:00
The physics world is now cleared on state swap (fixes #505)
This commit is contained in:
@@ -455,6 +455,19 @@ Phaser.Physics.World.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears all bodies from the simulation.
|
||||
*
|
||||
* @method Phaser.Physics.World#clear
|
||||
*/
|
||||
clear: function () {
|
||||
|
||||
this.world.clear();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears all bodies from the simulation and unlinks World from Game. Should only be called on game shutdown. Call `clear` on a State change.
|
||||
*
|
||||
* @method Phaser.Physics.World#destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
Reference in New Issue
Block a user