Module

utility

Methods

# static getExecutionBridge() → {string|Object}

Get the execution context bridge.

View Source browser/util.js, line 72

string | Object

# static isActiveElement(elem) → {boolean}

Determine whether game element is active.
Parameters:
Name Type Description
elem HTMLElement the HTML element

View Source browser/util.js, line 63

boolean

# static logGameStateToConsole(game, interval)

Log the running game state to the console
Parameters:
Name Type Description
game Game
interval number

View Source browser/util.js, line 112

# static randomColor() → {string}

Generate a random hex color code.

View Source browser/util.js, line 37

string

# static randomFromArray(arr) → {*}

Pick a random element from an array.
Parameters:
Name Type Description
arr array the array

View Source browser/util.js, line 28

*

# static randomNumber(min, max) → {number}

Generate a random number.
Parameters:
Name Type Description
min number the minimum number
max number the maximum number

View Source browser/util.js, line 17

number

# static timestamp(condense) → {string}

Create a timestamp.
Parameters:
Name Type Description
condense boolean remove separators e.g. "-" or "/"

View Source browser/util.js, line 48

string

# static trackWASDKeyboard() → {void}

Setup WASD keyboard tracking for the UI

View Source browser/util.js, line 86

void