Excalibur helper for defining colliders quickly

Hierarchy

  • Shape

Constructors

Methods

Constructors

Methods

  • Creates a box collider, under the hood defines a PolygonCollider collider

    Parameters

    • width: number

      Width of the box

    • height: number

      Height of the box

    • anchor: Vector = Vector.Half

      Anchor of the box (default (.5, .5)) which positions the box relative to the center of the collider's position

    • offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns PolygonCollider

  • Creates a new circle collider

    Circle colliders are useful for balls, or to make collisions more forgiving on sharp edges

    Parameters

    • radius: number

      Radius of the circle collider

    • offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns CircleCollider