Wes Mantooth - HTML5 Canvas Game Engine - Version 2.x - by Jeremy Heminger
Classes organised alphabetically
Motion
distance_to_point -> {Number}
return the distance between two poins
|
Name
|
Type
|
Description
|
| x1 | Number | x1 coordinate |
| y1 | Number | y1 coordinate |
| x2 | Number | x2 coordinate |
| y2 | Number | y2 coordinate |
point_direction -> {Number}
returns the direction of x2,y2 from x1,y1 in radians or degrees
|
Name
|
Type
|
Description
|
| x1 | Number | x1 coordinate |
| y1 | Number | y1 coordinate |
| x2 | Number | x2 coordinate |
| y2 | Number | y2 coordinate |
|
radians
|
Boolean
|
true return radians
false return degrees
|
motion_set -> {Array}
updates an x,y position in a direction based on speed
|
Name
|
Type
|
Description
|
|
x
|
Number
|
|
|
y
|
Number
|
|
|
degrees
|
Number
|
If using degrees you must ensure that you are passing a whole number
A float point number will be assumed to be in radians
|