createBody(x, y, mass, addToWorld, options, points) → {Phaser.Physics.P2.Body}
Creates a new Body and adds it to the World.
Parameters
| Name | Type | Argument | Default | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |  number | The x coordinate of Body.  |  ||||||||||||||||||||||
y |  number | The y coordinate of Body.  |  ||||||||||||||||||||||
mass |  number | The mass of the Body. A mass of 0 means a 'static' Body is created.  |  ||||||||||||||||||||||
addToWorld |  boolean |  <optional> |  false | Automatically add this Body to the world? (usually false as it won't have any shapes on construction).  |  ||||||||||||||||||||
options |  object | 
 An object containing the build options: Properties
  |  ||||||||||||||||||||||
points |  Array.<number> | number | An array of 2d vectors that form the convex or concave polygon.  |  
Returns
The body
- Source code: physics/p2/World.js (Line 1542)
 
Please login to continue.