⚙ A collections of JavaScript libraries that help making websites and games easier.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
LICENSE
README.md
package.json

README.md

[INACTIVE] WebUtils

A collections of JavaScript libraries that help making web sites, apps, and games easier.

See https://github.com/nektro/basalt instead!


general.js

addScript(url, callback)
add a script located at {url} to the page and optionally run {callback} when script has finished loading
getInheritance(o)
returns an array containing the inheritance tree of an Object {o}
solve(x, op, y)
solve the math equation x op y

keyboard.js

KeyHelp.isKeydown(key)
return if the {key} is being being pressed down
KeyHelp.areKeysDown(keyArry)
return true if all of the keys in {keyArray} are pressed Down
KeyHelp.getKeyMap()
return an Array of all keys currently being pressed
KeyHelp.codes
Map of key names to key codes

geometry.js

Do 2D geometry with ease

  • Point
    • constructor(x, y)
    • distanceTo(Point) : Number
    • add(Point) : this
  • Circle
    • constructor(x, y, radius)
    • center() : Point
    • intersects(Point|Circle) : Boolean

classes/Game.js

  • GameObject
    • constructor()
    • addState(GameState)
    • gotoState(Number)
    • start()
    • next()
  • GameState
    • constructor()
    • init()
    • update()
    • draw()
    • onKeyPressed()
    • onClick()

classes/Loop.js

Keep count, never go out of bounds

  • Loop
    • constructor(min, max, startValue)
    • inc()
    • dec()
    • get this.value

classes/Looper.js

Call a function every certain amount of time Requires Loop.js

  • Looper
    • constructor(min, max, start, framerate, function)
    • update() // must be called every frame