Skip to main content

Math

Functions

distance

Returns the distance between two positions.

Math:distance(p1: object, p2: object) -> number

collision

Returns true if the two rectangles overlap.

Math.bounded(rectangle1: object, rectangle2: object, scale: number) -> boolean

bounded

Returns true if one of the rectangles is completely inside another.

Math.bounded(rectangle1: object, rectangle2: object) -> boolean