clik-engine API
    Preparing search index...

    A component to apply force to Matter.js bodies.

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

    Implemented by

    Index

    Methods

    • Applies a force to a body.

      Parameters

      Returns this

    • Applies a force to a body from a given position.

      Parameters

      Returns this

    • 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