Game utilities.
Methods
# static isActiveElement(elem) → {boolean}
Determine whether game element is active.
Parameters:
Name | Type | Description |
---|---|---|
elem |
HTMLElement
|
the HTML element |
boolean
# static logGameStateToConsole(game, interval)
Log the running game state to the console
Parameters:
Name | Type | Description |
---|---|---|
game |
Game
|
|
interval |
number
|
# static randomFromArray(arr) → {*}
Pick a random element from an array.
Parameters:
Name | Type | Description |
---|---|---|
arr |
array
|
the array |
*
# static randomNumber(min, max) → {number}
Generate a random number.
Parameters:
Name | Type | Description |
---|---|---|
min |
number
|
the minimum number |
max |
number
|
the maximum number |
number
# static timestamp(condense) → {string}
Create a timestamp.
Parameters:
Name | Type | Description |
---|---|---|
condense |
boolean
|
remove separators e.g. "-" or "/" |
string