Physics#startSystem()

startSystem(system)

This will create an instance of the requested physics simulation.
Phaser.Physics.Arcade is running by default, but all others need activating directly.

You can start the following physics systems:

Phaser.Physics.P2JS - A full-body advanced physics system by Stefan Hedman.
Phaser.Physics.NINJA - A port of Metanet Softwares N+ physics system.
Phaser.Physics.BOX2D - A commercial Phaser Plugin (see http://phaser.io)

Both Ninja Physics and Box2D require their respective plugins to be loaded before you can start them.
They are not bundled into the core Phaser library.

If the physics world has already been created (i.e. in another state in your game) then
calling startSystem will reset the physics world, not re-create it. If you need to start them again from their constructors
then set Phaser.Physics.p2 (or whichever system you want to recreate) to null before calling startSystem.

Parameters
Name Type Description
system number

The physics system to start: Phaser.Physics.ARCADE, Phaser.Physics.P2JS, Phaser.Physics.NINJA or Phaser.Physics.BOX2D.

Source code: physics/Physics.js (Line 142)
doc_phaser
2017-02-14 10:58:48
Comments
Leave a Comment

Please login to continue.