Wes Mantooth - HTML5 Canvas Game Engine - Version 2.x - by Jeremy Heminger

Classes organised alphabetically

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
Name Type Description
x Number
y Number
radius Number

checkCircle -> {Boolean}

check collision of two circles

Name Type Description
x1Numberx1 coordinate
y1Numbery1 coordinate
r1Numberr1 coordinate
x2Numberx2 coordinate
y2Numbery2 coordinate
r2Numberr2 coordinate

insideCanvas -> {Boolean}

check if target coords are inside the referenced canvas area

Name Type Description
iIntegerreference to the canvas
x1Numberx1 coordinate
y1Numbery1 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
x1Numberx1 coordinate
y1Numbery1 coordinate