The acceleration is the rate of change of the velocity.
The acceleration is the rate of change of the velocity. Measured in pixels per second squared.
Allow this Body to be influenced by gravity? Either world or local.
Allow this Body to be rotated? (via angularVelocity, etc)
The angle of the Body's velocity in radians.
The angular acceleration is the rate of change of the angular velocity.
The angular acceleration is the rate of change of the angular velocity. Measured in degrees per second squared.
The drag applied during the rotation of the Body.
The drag applied during the rotation of the Body. Measured in degrees per second squared.
The angular velocity controls the rotation speed of the Body.
The angular velocity controls the rotation speed of the Body. It is measured in degrees per second.
This object is populated with boolean values when the Body collides with the World bounds or a Tile.
This object is populated with boolean values when the Body collides with the World bounds or a Tile. For example if blocked.up is true then the Body cannot move up. An object containing on which faces this Body is blocked from moving, if any.
The bottom value of this Body (same as Body.y + Body.height)
The elasticity of the Body when colliding.
The elasticity of the Body when colliding. bounce.x/y = 1 means full rebound, bounce.x/y = 0.5 means 50% rebound velocity.
The center coordinate of the Physics Body.
Set the checkCollision properties to control which directions collision is processed for this Body.
Set the checkCollision properties to control which directions collision is processed for this Body.
For example checkCollision.up = false means it won't collide when the collision happened while moving up.
If you need to disable a Body entirely, use body.enable = false
, this will also disable motion.
If you need to disable just collision and/or overlap checks, but retain motion, set checkCollision.none = true
.
An object containing allowed collision.
A Body can be set to collide against the World bounds automatically and rebound back into the World if this is set to true.
A Body can be set to collide against the World bounds automatically and rebound back into the World if this is set to true. Otherwise it will leave the World. Should the Body collide with the World bounds?
This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate.
This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate. Used in combination with your own collision processHandler you can create whatever type of collision response you need. Use a custom separation system or the built-in one?
This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate.
This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate. Used in combination with your own collision processHandler you can create whatever type of collision response you need. Use a custom separation system or the built-in one?
The Sprite position is updated based on the delta x/y values.
The Sprite position is updated based on the delta x/y values. You can set a cap on those (both +-) using deltaMax.
If this Body in a preUpdate (true) or postUpdate (false) state?
The drag applied to the motion of the Body.
If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true.
If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true. Body embed value.
A disabled body won't be checked for any form of collision or overlap or have its pre/post updates run.
A const reference to the direction the Body is traveling or facing.
The amount of movement that will occur if another object 'rides' this one.
Local reference to game.
A local gravity applied to this Body.
A local gravity applied to this Body. If non-zero this over rides any world gravity, unless Body.allowGravity is set to false.
The calculated height / 2 of the physics body.
The calculated width / 2 of the physics body.
The calculated height of the physics body.
An immovable Body will not receive any impacts from other bodies.
If true this Body is using circular collision detection.
If true this Body is using circular collision detection. If false it is using rectangular. Use Body.setCircle to control the collision shape this Body uses.
Set by the moveTo and moveFrom methods.
The x position of the Body.
The x position of the Body. The same as Body.x
.
The mass of the Body.
The mass of the Body. When two bodies collide their mass is used in the calculation to determine the exchange of velocity (default: 1).
The maximum angular velocity in degrees per second that the Body can reach.
The maximum velocity in pixels per second sq.
The maximum velocity in pixels per second sq. that the Body can reach.
Optional callback.
Optional callback. If set, invoked during the running of moveTo
or moveFrom
events.
Context in which to call the movementCallback.
If you have a Body that is being moved around the world via a tween or a Group motion, but its local x/y position never actually changes, then you should set Body.moves = false.
If you have a Body that is being moved around the world via a tween or a Group motion, but its local x/y position never actually changes, then you should set Body.moves = false. Otherwise it will most likely fly off the screen.
If you want the physics system to move the body around, then set moves to true. Set to true to allow the Physics system to move this Body, otherwise false to move it manually.
The new velocity.
The new velocity. Calculated during the Body.preUpdate and applied to its position.
The offset of the Physics Body from the Sprite x/y position.
A Signal that is dispatched when this Body collides with another Body.
A Signal that is dispatched when this Body collides with another Body. * You still need to call game.physics.arcade.collide in your update method in order for this signal to be dispatched. * Usually you'd pass a callback to the collide method, but this signal provides for a different level of notification. * Due to the potentially high volume of signals this could create it is disabled by default. * To use this feature set this property to a Phaser.Signal:
sprite.body.onCollide = new Phaser.Signal()
and it will be called when a collision happens, passing two arguments: the sprites which collided. The first sprite in the argument is always the owner of this Body. * If two Bodies with this Signal set collide, both will dispatch the Signal.
Listen for the completion of moveTo
or moveFrom
events.
A Signal that is dispatched when this Body overlaps with another Body.
A Signal that is dispatched when this Body overlaps with another Body.
You still need to call game.physics.arcade.overlap in your update method in order for this signal to be dispatched.
Usually you'd pass a callback to the overlap method, but this signal provides for a different level of notification.
Due to the potentially high volume of signals this could create it is disabled by default.
To use this feature set this property to a Phaser.Signal: sprite.body.onOverlap = new Phaser.Signal() and it will be called when a collision happens, passing two arguments: the sprites which collided. The first sprite in the argument is always the owner of this Body.
If two Bodies with this Signal set collide, both will dispatch the Signal.
A Signal that is dispatched when this Body collides with the world bounds.
A Signal that is dispatched when this Body collides with the world bounds. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal:
sprite.body.onWorldBounds = new Phaser.Signal()
and it will be called when a collision happens, passing five arguments:
onWorldBounds(sprite, up, down, left, right)
where the Sprite is a reference to the Sprite that owns this Body, and the other arguments are booleans indicating on which side of the world the Body collided.
If Body.isCircle
is true, and this body collides with another circular body, the amount of overlap is stored here.
If Body.isCircle
is true, and this body collides with another circular body, the amount of overlap is stored here.
The amount of overlap during the collision.
When this body collides with another, the amount of overlap is stored here.
When this body collides with another, the amount of overlap is stored here. The amount of horizontal overlap during the collision.
When this body collides with another, the amount of overlap is stored here.
When this body collides with another, the amount of overlap is stored here. The amount of vertical overlap during the collision.
The position of the physics body.
The previous rotation of the physics body.
The previous position of the physics body.
The radius of the circular collision shape this Body is using if Body.setCircle has been enabled.
The radius of the circular collision shape this Body is using if Body.setCircle has been enabled. If you wish to change the radius then call setCircle again with the new value. If you wish to stop the Body using a circle then call setCircle with a radius of zero (or undefined).
The right value of this Body (same as Body.x + Body.width)
The Body's rotation in degrees, as calculated by its angularVelocity and angularAcceleration.
The Body's rotation in degrees, as calculated by its angularVelocity and angularAcceleration. Please understand that the collision Body
itself never rotates, it is always axis-aligned. However these values are passed up to the parent Sprite and updates its rotation.
If true and you collide this Sprite against a Group, it will disable the collision check from using a QuadTree.
The un-scaled original size.
The un-scaled original size.
The speed of the Body as calculated by its velocity.
Set by the moveTo and moveFrom methods.
If true the Body will check itself against the Sprite.getBounds() dimensions and adjust its width and height accordingly.
If true the Body will check itself against the Sprite.getBounds() dimensions and adjust its width and height accordingly. If false it will compare its dimensions against the Sprite scale instead, and adjust its width height if the scale has changed. Typically you would need to enable syncBounds if your sprite is the child of a responsive display object such as a FlexLayer, or in any situation where the Sprite scale doesn't change, but its parents scale is effecting the dimensions regardless.
If this is an especially small or fast moving object then it can sometimes skip over tilemap collisions if it moves through a tile in a step.
If this is an especially small or fast moving object then it can sometimes skip over tilemap collisions if it moves through a tile in a step.
Set this padding value to add extra padding to its bounds. tilePadding.x applied to its width, y to its height. Extra padding to be added to this sprite's dimensions when checking for tile collision.
The y position of the Body.
The y position of the Body. The same as Body.y.
This object is populated with boolean values when the Body collides with another.
This object is populated with boolean values when the Body collides with another. touching.up = true means the collision happened to the top of this Body for example. An object containing touching results.
The type of physics system this body belongs to.
The velocity, or rate of change in speed of the Body.
The velocity, or rate of change in speed of the Body. Measured in pixels per second.
This object is populated with previous touching values from the bodies previous collision.
This object is populated with previous touching values from the bodies previous collision. An object containing previous touching results.
The calculated width of the physics body.
The elasticity of the Body when colliding with the World bounds.
The elasticity of the Body when colliding with the World bounds. By default this property is null, in which case Body.bounce is used instead. Set this property to a Phaser.Point object in order to enable a World bounds specific bounce value.
The x position.
The y position.
The Physics Body is linked to a single Sprite. All physics operations should be performed against the body rather than the Sprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body.
https://phaser.io/docs/2.6.2/Phaser.Physics.Arcade.Body.html