window.onload = function() {
Crafty.init();
// A blue block, controlled by arrow keys
var player = Crafty.e("2D, Canvas, Color, Fourway")
.attr({x:100, y:100, w:50, h:50})
.color("blue")
.fourway(3);
};
for Javascript games
Open Source
Crafty is actively developed on Github, and we welcome contributions! See release notes.
Cross Browser compatible
Your games will work on all modern browsers, including IE9.
Canvas or DOM
Choose the technology to render your entities, it will look exactly the same.
Small file size
Small enough that you don't need to wory about it delaying your game.
Entity Component System
A better way to approach game development without long chains of inheritance.
Sprite Map support
Splice and dice a sprite map to easily draw game entities.
Collision Detection
Advanced SAT collision detection with more information than just true or false.
Fire & Forget Events
Event system for custom events that can be triggered whenever, on whatever, and bound just as easily.
Lots 'o Goodies
Heaps of native components for sound, animation, effects and input to make your game pop!
Installation
npm module
Crafty is available as an npm module.
$ npm install craftyjs
You can see an example on how to get started:
npm exampleBower installation
With bower installed, the command
$ bower install crafty
will fetch the lastest version of crafty and install it in your project's bower directory.
Bleeding edge
Fresh builds are uploaded by Travis after every successful merge:
Nightly distributionDemos
Development team
Active team members:
- starwed (maintainer)
- Kevin Simper
- mucaho
Original author: Louis Stowasser