Skip to content

A high performance game engine, runs a Box2D physics engine in a Web Worker to take advantage of multiple CPUs. ABANDONED.

Notifications You must be signed in to change notification settings

insidewhy/cc.gamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc.gamer

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.

examples

installation

Source files:

The physics.js has to be distributed in a separate file to run in the Web Worker API.

To include in a web page:

<script source="cc/gamer.js"></script>

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:

<script source="http://ccg.chilon.net/cc/gamer.js"></script>

To install globally on your system using npm:

sudo npm install -g cc.gamer

about 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.

It is written in CoffeeScript but distributed in both minified and readable compiled JavaScript formats neither of which depend on CoffeeScript in any way.

usage

starting out

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.

cc.gamer uses cc.extend to structure its classes. This provides an API similar to ImpactJS' class system but written in coffeescript and without support for singletons.

first game with cc.gamer

cc.gamer games use an instance of the Resources class to load sprites, sound and...

TODO describe cc.Resources

testing

% 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/

developing

% npm test

The test system will automatically reload and re-generate cc/gamer.js as you edit the code.

dependencies

All dependencies are included in cc.gamer.js. They incude the excellent:

status

  • 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
  • Entity:
    • 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
    • Physics:
      • 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

notes

  • cc.gamer uses a port of box2d 2.2 compiled from C++ to JavaScript using emscripten.

About

A high performance game engine, runs a Box2D physics engine in a Web Worker to take advantage of multiple CPUs. ABANDONED.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published