phaser - v4.0.0-rc.4
    Preparing search index...
    • Separates two overlapping bodies on the X-axis (horizontally).

      Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection.

      The bodies won't be separated if there is no horizontal overlap between them, if they are static, or if either one uses custom logic for its separation.

      Parameters

      • body1: Physics.Arcade.Body

        The first Body to separate.

      • body2: Physics.Arcade.Body

        The second Body to separate.

      • overlapOnly: boolean

        If true, the bodies will only have their overlap data set and no separation will take place.

      • bias: number

        A value to add to the delta value during overlap checking. Used to prevent sprite tunneling.

      • Optionaloverlap: number

        If given then this value will be used as the overlap and no check will be run.

      Returns boolean