This is heavily work in process code, and as such is likely to change without warning.
JavaScript PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

#Thorny Engine

Thorny Engine is a HTML5 game engine that attempts to bring traditional game development technologies to the open web, such as astar/funnel pathfinding, an entity component system and a highly modifiable architecture. The engine that allows developers to write game logic once, and have it work in Node.js and a myriad of modern browsers.


  • Comprehensive unittests using the Jasmine BDD framework
  • A* Pathfinder - Used to navigate around a simple node list
  • Funnel Pathfinder - Used to find optimal paths through a polygone based level
  • Customisable Level Formats - Comes out of the box with a polygone based level system, but is easily extensable to support square and hexagon based grids
  • Supports modern browser and Node.js
  • Entity Component System - Helps to separate and modularise complex game logic, making the code easier to write, test and debug


###Entity Component System

/*global console Stats, window*/
require('./thorny/base')('./config/default.json', './demos/config.processing.json')(function ($) {
	var gameLoop = $('thorny core game-loop').factory();
		.addComponent('renderer', {
			system: 'processing',
			element: 'processing-canvas-1',
			width: 640,
			height: 480
		.addComponent('load-level', './content/levels/room1.json')
		.addComponent('load-level', './content/levels/room2.json')
	// Spawn a dozen moving balls
	(function () {
		var i, x, y;
		for (i = 0; i < 12; i += 1) {
			x = Math.random() * 400 + 50;
			y = Math.random() * 450;
				.addComponent('position', {
					position: {
						x: x, 
						y: y
					facing: {
						x: 1, 
						y: 0
				.addComponent('moveable', {
					speed: 5
				.addComponent('follow-path', {
					name: 'side-to-side',
					route: [
						{x: 500, y: 0},
						{x: 50, y: 400}
					type: 'cycle',
					active: true
	$.event().bind('world-loaded', function () {
		gameLoop.start(function () {
			// Process any object that needs to move.
				.each(function (moveable) {;

		}, function () {
			// Execute all of the renderer's
				.each(function (renderer) {;

##TODO Following is a list of technologies that I would like to support in time. Used to make the moving of entities less jittery when there is a ton of network latency. or To allow objects to bounce around a level with real physics. To allow chained narrative. Looks like it'll make syncing entities over the network really easy.