Creating shapes for calculating collision
Returns a Point collision shape object
Parameter | Type | Description |
---|---|---|
x | Number | x position of the Point |
y | Number | y position of the Point |
Returns a Box collision shape object
Parameter | Type | Description |
---|---|---|
x | Number | x position of the Box |
y | Number | y position of the Box |
width | Number | width of the Box |
height | Number | height of the Box |
Returns a Circle collision shape object
Parameter | Type | Description |
---|---|---|
x | Number | x position of the Circle |
y | Number | y position of the Circle |
r | Number | radius of the Circle |
Returns a Line collision shape object
Parameter | Type | Description |
---|---|---|
x1 | Number | x position of the first point of the Line |
y1 | Number | y position of the first point of the Line |
x2 | Number | x position of the second point of the Line |
y2 | Number | y position of the second point of the Line |
Returns a Polygon collision shape object
Parameter | Type | Description |
---|---|---|
points | [Point] | points of the Polygon. Can be made up of Points, arrays setup like: [x, y], or a combination. |