Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JavaScript game library
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
models
public
routes
states
views
.gitignore
README.md
package.json
server.js

README.md

jsGameLib

This is a work in progress. At the moment, it's less of a "library" and more of a "collection of files and utils that you can hack to your needs."

Use

Install dependencies with npm:

npm install

Run with node:

node server

Resources

You configure resources by adding to the files in public/json

sounds.json

Like this:

{
  "sound-name": "/sounds/sound-file-without-the-extension"
}

The extension is added automatically based on which sound formats the browser supports. See the Buzz (Buzz powers jsGameLib's sounds) docs for more.

sprites.json

Like this:

{
  "ship": {
    "img": "/img/sprites/ship.png",
    "width": 500,
    "height": 500,
    "scaleWidth": 64,
    "scaleHeight": 64,
    "animations": [
      {
        "name": "up",
        "frames": 2,
        "duration": 20
      }
    ]
  }
}

Your own data

You can add your own arbitrary config/data files by creating JSON files and adding them to the array in public/js/services/data-loader.js.

License

MIT

Something went wrong with that request. Please try again.