A high performance sprite based open source HTML5 game engine. It uses WebGL if available for graphics and takes advantage of multiple core processors by using Web Workers when available. Super accurate physics using Box2D are provided.
The physics.js has to be distributed in a separate file to run in the Web Worker API.
To include in a web page:
In order to take advantage of multi-core CPUs you must download the files and host them on your own server. Otherwise single-threaded mode can be used with the following line:
To install globally on your system using npm:
sudo npm install -g cc.gamer
After trying a dozen open source html5 game engines I was disappointed than none seemed as good as the commercial effort ImpactJS. cc.gamer provides a fully functional sprite based game environment with a liberal license (MIT). It has a fast WebGL graphics backend for browsers that support it and will have a canvas fallback soon. The physics engine runs in a Web Worker process to avoid blocking the graphics engine and to take advantage of processors with multiple cores.
This library is for creating retro sprite based games based on tiles but the WebGL backend does have support for some 3D features.
cc.gamer uses the cc.loader module system which provides a similar API to ImpactJS' module system but written in coffeescript and with several extensions. It isn't necessary to use it for your own project but if you wish you can read about it here. The part about using ccbaker may be of interest if you wish to deploy your game in minified form.
first game with cc.gamer
cc.gamer games use an instance of the Resources class to load sprites, sound and...
TODO describe cc.Resources
% git clone git://github.com/nuisanceofcats/cc.gamer.git % cd cc.gamer % npm test cc.gamer test server listening on: 8014 please go to http://localhost:8014/
% npm test
The test system will automatically reload and re-generate cc/gamer.js as you edit the code.
All dependencies are included in cc.gamer.js. They incude the excellent:
- Module system: done cc.loader
- Class system: done cc.extend
- WebGL backend: in progress
- Spritesheet Animation: done
- Pushing many Spritesheets into a WebGL texture: done
- Shader API for entities: done
- Shader API for surfaces
- tessellating tiles: done
- tile coverings/corners: todo
- Canvas backend: to do
- Resource loading/caching: done
- Physics (using Box2D js):
- Run physics engine in web worker: done
- Masks to control what Entities can collide: done
- Velocity/Position/Acceleration updating: done
- Spritesheet animations: done
- Optional hitbox: done
- Detect if entity is standing on surface (box2d sensor under feet): done
- Collision detection: done
- Collision events: done
- Set velocity: done
- Initial position: done
- Gravity: done
- Acceleration: done
- Teleport position: todo
- Input: done
- Surface: done
- Loading Screen: to do