Dynamic Body.
Facing down.
Facing left.
Facing no direction (initial value).
Facing right.
Facing up.
Arcade Physics Group containing Dynamic Bodies.
Static Body.
A Tilemap Layer.
Calculates and returns the bitmask needed to determine if the given categories will collide with each other or not.
name | type | description |
---|---|---|
categories | number | Array.<number> |
A unique category bitfield, or an array of them. |
The collision mask.
Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties
accordingly, including: touching.left
, touching.right
, touching.none
and `overlapX'.
name | type | description |
---|---|---|
body1 | Phaser.Physics.Arcade.Body |
The first Body to separate. |
body2 | Phaser.Physics.Arcade.Body |
The second Body to separate. |
overlapOnly | boolean |
Is this an overlap only check, or part of separation? |
bias | number |
A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). |
The amount of overlap.
Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties
accordingly, including: touching.up
, touching.down
, touching.none
and `overlapY'.
name | type | description |
---|---|---|
body1 | Phaser.Physics.Arcade.Body |
The first Body to separate. |
body2 | Phaser.Physics.Arcade.Body |
The second Body to separate. |
overlapOnly | boolean |
Is this an overlap only check, or part of separation? |
bias | number |
A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). |
The amount of overlap.
Separates two overlapping bodies on the X-axis (horizontally).
Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection.
The bodies won't be separated if there is no horizontal overlap between them, if they are static, or if either one uses custom logic for its separation.
name | type | arguments | description |
---|---|---|---|
body1 | Phaser.Physics.Arcade.Body |
The first Body to separate. |
|
body2 | Phaser.Physics.Arcade.Body |
The second Body to separate. |
|
overlapOnly | boolean |
If |
|
bias | number |
A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. |
|
overlap | number | <optional> |
If given then this value will be used as the overlap and no check will be run. |
true
if the two bodies overlap vertically, otherwise false
.
Separates two overlapping bodies on the Y-axis (vertically).
Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection.
The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation.
name | type | arguments | description |
---|---|---|---|
body1 | Phaser.Physics.Arcade.Body |
The first Body to separate. |
|
body2 | Phaser.Physics.Arcade.Body |
The second Body to separate. |
|
overlapOnly | boolean |
If |
|
bias | number |
A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. |
|
overlap | number | <optional> |
If given then this value will be used as the overlap and no check will be run. |
true
if the two bodies overlap vertically, otherwise false
.
Either sets or creates the Arcade Body Collision object.
Mostly only used internally.
name | type | arguments | description |
---|---|---|---|
noneFlip | boolean |
Is |
|
data | Phaser.Types.Physics.Arcade.ArcadeBodyCollision | <optional> |
The collision data object to populate, or create if not given. |
The collision data.