Collision
circle -> {Boolean}
check collision with a polygon and a circle
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| p | Array |
a two dimensional array containing the coordinates of the polygon
[ [ x,y ],[ x,y ],[ x,y ] ] |
||||||||||||
| c | Object | The circle to be tested
|
checkCircle -> {Boolean}
check collision of two circles
| Name | Type | Description |
|---|---|---|
| x1 | Number | x1 coordinate |
| y1 | Number | y1 coordinate |
| r1 | Number | r1 coordinate |
| x2 | Number | x2 coordinate |
| y2 | Number | y2 coordinate |
| r2 | Number | r2 coordinate |
insideCanvas -> {Boolean}
check if target coords are inside the referenced canvas area
| Name | Type | Description |
|---|---|---|
| i | Integer | reference to the canvas |
| x1 | Number | x1 coordinate |
| y1 | Number | y1 coordinate |
inside -> {Boolean}
check if polygon is inside of another polygon
| Name | Type | Description |
|---|---|---|
| point | Array |
an array containing the x,y coordinates to test against
[ x,y ] |
| vs | Array |
a two dimensional array containing the coordinates of the polygon
[ [ x,y ],[ x,y ],[ x,y ] ] |
objectNearest -> {Object}
find the nearest object to x,y
| Name | Type | Description |
|---|---|---|
| x1 | Number | x1 coordinate |
| y1 | Number | y1 coordinate |