Phaser.Physics.Arcade.Components.Acceleration

Scope: static

Source: src/physics/arcade/components/Acceleration.js#L7
Since: 3.0.0

Methods:

Public Members

setAcceleration

<instance> setAcceleration(x, [y])

Description:

Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration.

Parameters:

nametypeoptionaldefaultdescription
xnumberNoThe horizontal acceleration
ynumberYes"x"The vertical acceleration

Returns: Phaser.Physics.Arcade.Components.Acceleration - This Game Object.

Source: src/physics/arcade/components/Acceleration.js#L15
Since: 3.0.0


setAccelerationX

<instance> setAccelerationX(value)

Description:

Sets the body's horizontal acceleration.

Parameters:

nametypeoptionaldescription
valuenumberNoThe horizontal acceleration

Returns: Phaser.Physics.Arcade.Components.Acceleration - This Game Object.

Source: src/physics/arcade/components/Acceleration.js#L33
Since: 3.0.0


setAccelerationY

<instance> setAccelerationY(value)

Description:

Sets the body's vertical acceleration.

Parameters:

nametypeoptionaldescription
valuenumberNoThe vertical acceleration

Returns: Phaser.Physics.Arcade.Components.Acceleration - This Game Object.

Source: src/physics/arcade/components/Acceleration.js#L50
Since: 3.0.0


Private Members

Updated on