A streaming stat leveling API.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE-MIT
README.md
index.js
package.json

README.md

leveler

A streaming stat leveling API.

example

var leveler = require('leveler')

// Create a leveling thing
var exp = leveler(function(points) {
  return Math.floor(Math.floor(25 + Math.sqrt(625 + 100 * points)) / 50)

  // or if you need async emit 'levelup' and return false
  // exp.emit('levelup', level)
  // return false
})

// Every second add 100 experience points
setInterval(function() {
  exp.write(100)
}, 1000)

exp.on('data', function(level) {
  console.log('Player has reached level ' + level + ' with ' + exp.points + ' exp!')
})

install

With npm do:

npm install leveler

Use browserify to require('leveler').

release history

  • 0.1.0 - initial release

license

Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.