Phaser.Physics.Matter.Components.Force

Scope: static

Source: src/physics/matter-js/components/Force.js#L9
Since: 3.0.0

Methods:

Public Members

applyForce

<instance> applyForce(force)

Description:

Applies a force to a body.

Parameters:

nametypeoptionaldescription
forcePhaser.Math.Vector2NoA Vector that specifies the force to apply.

Returns: Phaser.Physics.Matter.Components.Force - This Game Object instance.

Source: src/physics/matter-js/components/Force.js#L19
Since: 3.0.0


applyForceFrom

<instance> applyForceFrom(position, force)

Description:

Applies a force to a body from a given position.

Parameters:

nametypeoptionaldescription
positionPhaser.Math.Vector2NoThe position in which the force comes from.
forcePhaser.Math.Vector2NoA Vector that specifies the force to apply.

Returns: Phaser.Physics.Matter.Components.Force - This Game Object instance.

Source: src/physics/matter-js/components/Force.js#L38
Since: 3.0.0


thrust

<instance> thrust(speed)

Description:

Apply thrust to the forward position of the body.

Use very small values, such as 0.1, depending on the mass and required speed.

Parameters:

nametypeoptionaldescription
speednumberNoA speed value to be applied to a directional force.

Returns: Phaser.Physics.Matter.Components.Force - This Game Object instance.

Source: src/physics/matter-js/components/Force.js#L56
Since: 3.0.0


thrustBack

<instance> thrustBack(speed)

Description:

Apply thrust to the back position of the body.

Use very small values, such as 0.1, depending on the mass and required speed.

Parameters:

nametypeoptionaldescription
speednumberNoA speed value to be applied to a directional force.

Returns: Phaser.Physics.Matter.Components.Force - This Game Object instance.

Source: src/physics/matter-js/components/Force.js#L125
Since: 3.0.0


thrustLeft

<instance> thrustLeft(speed)

Description:

Apply thrust to the left position of the body.

Use very small values, such as 0.1, depending on the mass and required speed.

Parameters:

nametypeoptionaldescription
speednumberNoA speed value to be applied to a directional force.

Returns: Phaser.Physics.Matter.Components.Force - This Game Object instance.

Source: src/physics/matter-js/components/Force.js#L79
Since: 3.0.0


thrustRight

<instance> thrustRight(speed)

Description:

Apply thrust to the right position of the body.

Use very small values, such as 0.1, depending on the mass and required speed.

Parameters:

nametypeoptionaldescription
speednumberNoA speed value to be applied to a directional force.

Returns: Phaser.Physics.Matter.Components.Force - This Game Object instance.

Source: src/physics/matter-js/components/Force.js#L102
Since: 3.0.0


Private Members

Updated on