Package Exports
- gamejs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gamejs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
GameJs
GameJs is a JavaScript library for writing 2D games or other interactive graphic applications for the HTML Canvas.
Homepage: http://gamejs.org.
Topics
Drawing on the screen
- gamejs.image loading image files
- gamejs.graphics image transformation (rotate, transform,...) and drawing with geometric shapes
- gamejs.font rendering text
Mouse and keyboard
- gamejs.event Recieve events for user input
Audio
- gamejs.audio Playback with multiple channels
Game logic
- animate Spritesheets and animations
- tiledmap Load maps created with the Tiled map editor
- pathfinding A* Pathfinding
- pixelcollision Pixel perfect collision detection
Advanced
- thread utilize WebWorkers
- math/noise random noise generator
Math
- math/vectors
- math/matrix
- math/random random numbers and vectors
Usage
Standalone
Load the "gamejs.min.js" script and tell the module loader where your game's main module lies (usually "./javascript/main.js"):
<script src="./public/gamejs.min.js"></script>
<script>
require.setModuleRoot('./javascript/');
require.run('main')
</script>And inside "./javascript/main.js", you can require gamejs
and start your game:
var gamejs = require('gamejs');
gamejs.ready(function() {
...
});GameJs a node package with browserify
GameJs is a CommonJs package published on NPM. To use it with browserify install GameJs in your game's directory:
$ npm install gamejsAnd install browserify, if you don't already have it.
$ npm install -g browserifyYou can then bundle your application ("main.js") with all its dependencies - including GameJs - like so:
$ browserify ./main.js --out bundled.jsMore Help
See the GameJs Website for more help or drop us an email in the Mailing List.
Example application can be found in the examples/ directory.
Development - How to build
GameJs consists of CommonJs modules in ./src/ which we build and jshint with grunt. If you don't already have node and npm, install those. You will also need java on your path for building the distribution file.
Install then grunt commandline interface:
$ npm install -g grunt-cliIn the GameJs folder you cloned, install the dependencies to build using npm:
$ npm installBuild GameJs:
$ gruntThis will create the gamejs-VERSION.js file and a minified gamejs-VERSION.min.js which you can use standalone in the browser, as demonstrated in the examples.