Namespace: Impact

Phaser.Types.Physics. Impact

Type Definitions


BodyUpdateCallback(body)

Parameters:
Name Type Description
body Phaser.Physics.Impact.Body

[description]

Since: 3.0.0
Source: src/physics/impact/Body.js (Line 13)

CollisionOptions

Type:
  • object
Properties:
Name Type Argument Default Description
slopeTileProperty string <optional>
null

Slope IDs can be stored on tiles directly using Impacts tileset editor. If a tile has a property with the given slopeTileProperty string name, the value of that property for the tile will be used for its slope mapping. E.g. a 45 degree slope upward could be given a "slope" property with a value of 2.

slopeMap object <optional>
null

A tile index to slope definition map.

defaultCollidingSlope integer <optional>
null

If specified, the default slope ID to assign to a colliding tile. If not specified, the tile's index is used.

defaultNonCollidingSlope integer <optional>
0

The default slope ID to assign to a non-colliding tile.

Since: 3.0.0
Source: src/physics/impact/typedefs/CollisionOptions.js (Line 1)

JSONImpactBody

Type:
  • object
Properties:
Name Type Description
name string

[description]

size Phaser.Types.Math.Vector2Like

[description]

pos Phaser.Types.Math.Vector2Like

The entity's position in the game world.

vel Phaser.Types.Math.Vector2Like

Current velocity in pixels per second.

accel Phaser.Types.Math.Vector2Like

Current acceleration to be added to the entity's velocity per second. E.g. an entity with a vel.x of 0 and accel.x of 10 will have a vel.x of 100 ten seconds later.

friction Phaser.Types.Math.Vector2Like

Deceleration to be subtracted from the entity's velocity per second. Only applies if accel is 0.

maxVel Phaser.Types.Math.Vector2Like

The maximum velocity a body can move.

gravityFactor number

[description]

bounciness number

[description]

minBounceVelocity number

[description]

type Phaser.Physics.Impact.TYPE

[description]

checkAgainst Phaser.Physics.Impact.TYPE

[description]

collides Phaser.Physics.Impact.COLLIDES

[description]

Since: 3.0.0
Source: src/physics/impact/typedefs/JSONImpactBody.js (Line 1)

WorldConfig

Type:
  • object
Properties:
Name Type Argument Default Description
gravity number <optional>
0

Sets Phaser.Physics.Impact.World#gravity

cellSize number <optional>
64

The size of the cells used for the broadphase pass. Increase this value if you have lots of large objects in the world.

timeScale number <optional>
1

A number that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed.

maxStep number <optional>
0.05

[description]

debug boolean <optional>
false

Sets Phaser.Physics.Impact.World#debug.

maxVelocity number <optional>
100

The maximum velocity a body can move.

debugShowBody boolean <optional>
true

Whether the Body's boundary is drawn to the debug display.

debugShowVelocity boolean <optional>
true

Whether the Body's velocity is drawn to the debug display.

debugBodyColor number <optional>
0xff00ff

The color of this Body on the debug display.

debugVelocityColor number <optional>
0x00ff00

The color of the Body's velocity on the debug display.

maxVelocityX number <optional>
maxVelocity

Maximum X velocity objects can move.

maxVelocityY number <optional>
maxVelocity

Maximum Y velocity objects can move.

minBounceVelocity number <optional>
40

The minimum velocity an object can be moving at to be considered for bounce.

gravityFactor number <optional>
1

Gravity multiplier. Set to 0 for no gravity.

bounciness number <optional>
0

The default bounce, or restitution, of bodies in the world.

setBounds object | boolean <optional>

Should the world have bounds enabled by default?

Properties
Name Type Argument Default Description
x number <optional>
0

The x coordinate of the world bounds.

y number <optional>
0

The y coordinate of the world bounds.

width number <optional>

The width of the world bounds.

height number <optional>

The height of the world bounds.

thickness number <optional>
64

The thickness of the walls of the world bounds.

left boolean <optional>
true

Should the left-side world bounds wall be created?

right boolean <optional>
true

Should the right-side world bounds wall be created?

top boolean <optional>
true

Should the top world bounds wall be created?

bottom boolean <optional>
true

Should the bottom world bounds wall be created?

Since: 3.0.0
Source: src/physics/impact/typedefs/WorldConfig.js (Line 1)

WorldDefaults

An object containing the 4 wall bodies that bound the physics world.

Type:
  • object
Properties:
Name Type Description
debugShowBody boolean

Whether the Body's boundary is drawn to the debug display.

debugShowVelocity boolean

Whether the Body's velocity is drawn to the debug display.

bodyDebugColor number

The color of this Body on the debug display.

velocityDebugColor number

The color of the Body's velocity on the debug display.

maxVelocityX number

Maximum X velocity objects can move.

maxVelocityY number

Maximum Y velocity objects can move.

minBounceVelocity number

The minimum velocity an object can be moving at to be considered for bounce.

gravityFactor number

Gravity multiplier. Set to 0 for no gravity.

bounciness number

The default bounce, or restitution, of bodies in the world.

Since: 3.0.0
Source: src/physics/impact/typedefs/WorldDefaults.js (Line 1)

WorldWalls

Type:
  • object
Properties:
Name Type Argument Description
left Phaser.Physics.Impact.Body <nullable>

The left-side wall of the world bounds.

right Phaser.Physics.Impact.Body <nullable>

The right-side wall of the world bounds.

top Phaser.Physics.Impact.Body <nullable>

The top wall of the world bounds.

bottom Phaser.Physics.Impact.Body <nullable>

The bottom wall of the world bounds.

Since: 3.0.0
Source: src/physics/impact/typedefs/WorldWalls.js (Line 1)