Phaser API Documentation

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

name type arguments Default description
x number

The horizontal acceleration

y number <optional> x

The vertical acceleration

Returns:
Description:

This Game Object.

Examples: