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.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus in dicta doloremque neque laudantium molestias.
Dima is one of the first JavaScript game engines to support multi-threading with WebWorkers and graphics backends for canvas or WebGL.
Dima's core is very small at 3KB, and is enough to provide your game with the structure it needs. Dima also comes with other modules that are easy to use.
Dima comes with tooling support in the form of bower and component packages, yeoman generators, and it's own command line tool.
Easily set up your UI to bind to certain state in your game and never have to write any update drawing methods
Dima ships with several AI modules capable of pathfinding, modeling decisions by utility, and Machine Learning.
Dima lets you load the map files created with the great 2d level editing tool, Tiled.
Because the entity-system architecture is a relational model and entirely data driven, saving games is simple and easy.
Dima has many other official as well as community developed modules View More
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: