Namespace: Arcade

Phaser.Physics. Arcade

Classes

ArcadePhysics
Body
Collider
Factory
Group
Image
Sprite
StaticBody
StaticGroup
World

Namespaces

Components
Events
Tilemap

Members


<static, readonly> DYNAMIC_BODY :number

Dynamic Body.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 15)
See:

<static, readonly> FACING_DOWN :number

Facing down.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 85)
See:

<static, readonly> FACING_LEFT :number

Facing left.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 97)
See:

<static, readonly> FACING_NONE :number

Facing no direction (initial value).

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 61)
See:

<static, readonly> FACING_RIGHT :number

Facing right.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 109)
See:

<static, readonly> FACING_UP :number

Facing up.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 73)
See:

<static, readonly> GROUP :number

Arcade Physics Group containing Dynamic Bodies.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 41)

<static, readonly> STATIC_BODY :number

Static Body.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 28)
See:

<static, readonly> TILEMAPLAYER :number

A Tilemap Layer.

Type:
  • number
Since: 3.0.0
Source: src/physics/arcade/const.js (Line 51)

Methods


<static> GetOverlapX(body1, body2, overlapOnly, bias)

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'.

Parameters:
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).

Since: 3.0.0
Source: src/physics/arcade/GetOverlapX.js (Line 9)
Returns:

The amount of overlap.

Type
number

<static> GetOverlapY(body1, body2, overlapOnly, bias)

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'.

Parameters:
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).

Since: 3.0.0
Source: src/physics/arcade/GetOverlapY.js (Line 9)
Returns:

The amount of overlap.

Type
number

<static> SeparateX(body1, body2, overlapOnly, bias)

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.

Parameters:
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

If true, the bodies will only have their overlap data set and no separation will take place.

bias number

A value to add to the delta value during overlap checking. Used to prevent sprite tunneling.

Since: 3.0.0
Source: src/physics/arcade/SeparateX.js (Line 10)
Returns:

true if the two bodies overlap vertically, otherwise false.

Type
boolean

<static> SeparateY(body1, body2, overlapOnly, bias)

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.

Parameters:
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

If true, the bodies will only have their overlap data set and no separation will take place.

bias number

A value to add to the delta value during overlap checking. Used to prevent sprite tunneling.

Since: 3.0.0
Source: src/physics/arcade/SeparateY.js (Line 10)
Returns:

true if the two bodies overlap vertically, otherwise false.

Type
boolean