Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

JavaScript game library

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 models
Octocat-spinner-32 public
Octocat-spinner-32 routes
Octocat-spinner-32 states
Octocat-spinner-32 views
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
Octocat-spinner-32 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.