Skip to content

btford/jsGameLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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