An open-source, high-performance, HTML5 game framework with an emphasis on an entity-system architecture.
Download Dima.js v0.1.0 Learn To Make Your Own GamesDima.js is a game framework for making games in Javascript and HTML5. Dima makes building games of medium to large scale easier than ever.
At its core is a super light-weight framework that provides the structure for your games, and it's fine if that's all you choose to use but Dima also comes with (if you so choose) a large collection of modules that include various components and systems for common game development needs. The core is an entity-system architecture framework that let's you avoid the common pitfalls of a traditional OOP inheritence based game by separating out your game into entities, components, and systems.
Others have already written some amazing articles online about the numerous advantages of an Entity-System architecture that if you haven't read would be a good introduction.
To summarize entity system architectures let you be entirely flexible with the entities of your game without having to know their final structure.
dima.component('velocity', function () { var velocityComponent = function () { this.x = 0; this.y = 0; }; velocityComponent.prototype.set = function(x,y) { this.x = x; this.y = y; }; return velocityComponent; });
var playerEntity = dima.createEntity(); dima.attachComponentTo('velocity', playerEntity) .set(1,0);
dima.system('Movement', function () { return { requires: ['transform', 'velocity'], process: function (collection) { var transform, velocity; for(var i = 0; i < collection.length ; i += 2) { transform = collection[i]; velocity = collection[i+1]; transform.x += velocity.x; transform.y += velocity.y; } } }; });
Dima.js is an entirely open source project that you can contribute to in a variety of ways: