new Polygon(x, y, points)

a polygon Object.
Please do note that melonJS implements a simple Axis-Aligned Boxes collision algorithm, which requires all polygons used for collision to be convex with all vertices defined with clockwise winding.
A polygon is convex when all line segments connecting two points in the interior do not cross any edge of the polygon
(which means that all angles are less than 180 degrees), as described here below :

A polygon's winding is clockwise iff its vertices (points) are declared turning to the right. The image above shows COUNTERCLOCKWISE winding.

Methods

Returns:

staticcontainsPoint(x, y) → {boolean}

check if this Polygon contains the specified point
(Note: it is highly recommended to first do a hit test on the corresponding
bounding rect, as the function can be highly consuming with complex shapes)