Function createCircle

  • Create a body with a circular shape

    Parameters

    • world: World

      The world in which to create the body

    • center: Vector2

      The center of the body

    • radius: number

      The radius of the circle shape to attach

    • mass: number

      The mass to give the newly created body

    • friction: number

      The friction to apply during collisions with the new body

    • restitution: number

      The friction to apply during collisions with the new body

    • sensor: boolean = false
    • Optional data: any

    Returns Body

    The newly created body