Physics.P2#game

game : Phaser.Game Local reference to game. Source code: physics/p2/World.js (Line 25)

Physics.P2#friction

friction : number Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. Source code: physics/p2/World.js (Line 1839)

Physics.P2#frameRate

frameRate : number The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property. Source code: physics/p2/World.js (Line 60)

Physics.P2#everythingCollisionGroup

everythingCollisionGroup : Phaser.Physics.P2.CollisionGroup A default collision group. Source code: physics/p2/World.js (Line 227)

Physics.P2#endContactHandler()

endContactHandler(event) Handles a p2 end contact event. Parameters Name Type Description event object The event data. Source code: physics/p2/World.js (Line 527)

Physics.P2#enableBody()

enableBody(object, debug) Creates a P2 Physics body on the given game object.A game object can only have 1 physics body active at any one time, and it can't be changed until the body is nulled. Parameters Name Type Description object object The game object to create the physics body on. A body will only be created if this object has a null body property. debug boolean Create a debug object to go with this body? Source code: physics/p2/World.js (Line 372)

Physics.P2#enable()

enable(object, debug, children) This will create a P2 Physics body on the given game object or array of game objects.A game object can only have 1 physics body active at any one time, and it can't be changed until the object is destroyed.Note: When the game object is enabled for P2 physics it has its anchor x/y set to 0.5 so it becomes centered. Parameters Name Type Argument Default Description object object | array | Phaser.Group The game object to create the physics body on. Can also

Physics.P2#emitImpactEvent

emitImpactEvent : boolean Set to true if you want to the world to emit the "impact" event. Turning this off could improve performance. Source code: physics/p2/World.js (Line 1994)

Physics.P2#destroy()

destroy() Clears all bodies from the simulation and unlinks World from Game. Should only be called on game shutdown. Call clear on a State change. Source code: physics/p2/World.js (Line 874)

Physics.P2#createSpring()

createSpring(bodyA, bodyB, restLength, stiffness, damping, worldA, worldB, localA, localB) → {Phaser.Physics.P2.Spring} Creates a linear spring, connecting two bodies. A spring can have a resting length, a stiffness and damping. Parameters Name Type Argument Default Description bodyA Phaser.Sprite | Phaser.Physics.P2.Body | p2.Body First connected body. bodyB Phaser.Sprite | Phaser.Physics.P2.Body | p2.Body Second connected body. restLength number <optional> 1 Rest len