Type Definitions
compareFunction(a, b) → {number}
A function that compares two elements and returns a number that determines how they should be sorted.
Parameters:
Name | Type | Description |
---|---|---|
a |
object | |
b |
object |
Returns:
If compareFunction(a, b) returns less than 0, then a comes first.
If compareFunction(a, b) returns 0, then don't change the order of a relative to b.
If compareFunction(a, b) returns greater than 0, then b comes first.
- Type
- number
drawCallback(context)
A callback to perform drawing operations on a canvas
Parameters:
Name | Type | Description |
---|---|---|
context |
external:CanvasRenderingContext2D | The context to use for drawing |
- Source:
emptyCallback()
A callback that takes no parameters, and returns nothing.
See the user for the description of what it should do.
- Source:
isWalkable(x, y) → {boolean}
A function that tests if a given coordinate can be travelled across.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | The position along the x-axis on a grid |
y |
number | The position along the y-axis on a grid |
- Source:
Returns:
- Type
- boolean
onmouseupHandler(x, y)
A function that is called when a mouse button or touch is released.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | The x coordinate of the mouse or touch that was released. |
y |
number | The y coordinate of the mouse or touch that was released. |
saveDataGetFinished(err, data)
A function that is called when save data has finished being retrieved.
Parameters:
Name | Type | Description |
---|---|---|
err |
error | If defined, err is the error that occurred when retrieving the data. |
data |
object | The key-value pairs of data that were previously saved. |
- Source:
saveDataSetFinished(err)
A function that is called when save data has finished being stored.
Parameters:
Name | Type | Description |
---|---|---|
err |
error | If defined, err is the error that occurred when saving the data. |
- Source:
simulationCallback(elapsedMillis)
A callback to perform a single step in a simulation.
Parameters:
Name | Type | Description |
---|---|---|
elapsedMillis |
number | The number of milliseconds to advance the simulation by |
- Source: