Skip to content

Commit

Permalink
Test loading voxel-cs first instead of voxel-engine, removing game in…
Browse files Browse the repository at this point in the history
…stance
  • Loading branch information
deathcap committed Jan 29, 2014
1 parent 9d17fa6 commit 858ff44
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Plugins(game, opts) {

opts = opts || {};
this.require = opts.require || require;
this.masterPluginName = opts.masterPluginName || 'voxel-engine'; // synthetic 'plugin' created as parent of all
this.masterPluginName = opts.masterPluginName || 'voxel-cs'; // synthetic 'plugin' created as parent of all

// map plugin name to instances
this.all = {};
Expand Down Expand Up @@ -60,13 +60,10 @@ Plugins.prototype.scanAndInstantiate = function(name, opts) {
Plugins.prototype.instantiate = function(createPlugin, name, opts) {
var plugin;
if (!this.game && name === this.masterPluginName) {
// the 'master' plugin is the game object itself
this.game = plugin = createPlugin(opts);
// the 'master' plugin provides the game object itself
plugin = createPlugin(opts);
this.game = {}; // TODO: provide link to voxel-engine.. but client/server?
this.game.plugins = this;
if (process.browser && this.game.notCapable()) {
if (window.document) window.document.body.appendChild(this.game.notCapableMessage()); // TODO: find out why notCapable() isn't showing up
throw new Error('[voxel-plugins] fatal error: your system is not capable of running voxel-engine (game.notCapable)');
}
} else {
plugin = createPlugin(this.game, opts); // requires (game, opts) convention
if (!plugin) {
Expand Down

0 comments on commit 858ff44

Please sign in to comment.