phaser - v4.0.0-rc.4
    Preparing search index...

    Provides methods used for setting the acceleration properties of an Arcade Physics Body.

    interface Acceleration {
        setAcceleration(x: number, y?: number): this;
        setAccelerationX(value: number): this;
        setAccelerationY(value: number): this;
    }

    Implemented by

    Index

    Methods

    • 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

      • x: number

        The horizontal acceleration

      • Optionaly: number

        The vertical acceleration Default x.

      Returns this

    • Sets the body's horizontal acceleration.

      Parameters

      • value: number

        The horizontal acceleration

      Returns this

    • Sets the body's vertical acceleration.

      Parameters

      • value: number

        The vertical acceleration

      Returns this