Namespace: Acceleration

Phaser.Physics.Impact.Components. Acceleration

The Impact Acceleration component. Should be applied as a mixin.

Since: 3.0.0
Source: src/physics/impact/components/Acceleration.js (Line 7)

Methods


setAcceleration(x, y)

Sets the horizontal and vertical acceleration of this body.

Parameters:
Name Type Description
x number

The amount of horizontal acceleration to apply.

y number

The amount of vertical acceleration to apply.

Since: 3.0.0
Source: src/physics/impact/components/Acceleration.js (Line 50)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.Components.Acceleration

setAccelerationX(x)

Sets the horizontal acceleration of this body.

Parameters:
Name Type Description
x number

The amount of acceleration to apply.

Since: 3.0.0
Source: src/physics/impact/components/Acceleration.js (Line 16)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.Components.Acceleration

setAccelerationY(y)

Sets the vertical acceleration of this body.

Parameters:
Name Type Description
y number

The amount of acceleration to apply.

Since: 3.0.0
Source: src/physics/impact/components/Acceleration.js (Line 33)
Returns:

This Game Object.

Type
Phaser.Physics.Impact.Components.Acceleration