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

    A component to apply force to Matter.js bodies.

    interface Force {
        applyForce(force: Math.Vector2): this;
        applyForceFrom(position: Math.Vector2, force: Math.Vector2): this;
        thrust(speed: number): this;
        thrustBack(speed: number): this;
        thrustLeft(speed: number): this;
        thrustRight(speed: number): this;
    }

    Implemented by

    Index

    Methods

    • 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

      • speed: number

        A speed value to be applied to a directional force.

      Returns this

    • 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

      • speed: number

        A speed value to be applied to a directional force.

      Returns this

    • 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

      • speed: number

        A speed value to be applied to a directional force.

      Returns this

    • 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

      • speed: number

        A speed value to be applied to a directional force.

      Returns this