¶ nodeGameSocial Experiments in the Browser Copyright(c) 2012 Stefano Balietti MIT Licensed nodeGame is a free, open source, event-driven javascript framework for on line, multiplayer games in the browser. |
(function (node) { |
¶ version |
node.version = '0.6.3'; |
¶ Objects¶ node.logStandard out |
node.log = function () {}; |
¶ node.eventsInstance of the EventEmitter class Takes care of emitting the events and calling the proper listener functions See
node.EventEmitter
|
node.events = {};
|
node.msg = {};
|
|
node.socket = node.gsc = {}; |
|
¶ node.sessionContains a reference to all session variables Session variables can be saved and restored at a later stage |
node.session = {}; |
¶ node.playerInstance of node.Player Contains information about the player See
node.PlayerList.Player
|
node.player = {}; |
node.game = {}; |
|
node.game.memory = null; |
|
node.game.state = null; |
|
¶ node.storeMakes the nodeGame session persistent, saving it to the browser local database or to a cookie See
shelf.js
|
node.store = function() {}; |
¶ node.setupConfigures a specific feature of nodeGame and and stores
the settings in See
Setup
|
node.setup = function() {}; |
node.conf = {}; |
|
¶ node.supportA collection of features that are supported by the current browser |
node.support = {}; |
¶ DependenciesLoad dependencies |
if ('object' === typeof module && 'function' === typeof require) { |
require('./lib/modules/log.js');
require('./lib/modules/variables.js');
require('./init.node.js');
require('./lib/nodegame.js');
require('./lib/modules/fs.js');
require('./lib/modules/setup.js');
require('./lib/modules/alias.js');
require('./lib/modules/random.js');
|
|
¶ Loading Sockets |
require('./lib/sockets/SocketIo.js');
require('./lib/sockets/SocketDirect.js');
|
¶ Loading Event listeners |
require('./listeners/incoming.js');
require('./listeners/internal.js');
require('./listeners/outgoing.js');
}
else { |
if ('undefined' !== typeof JSUS) node.JSUS = JSUS;
if ('undefined' !== typeof NDDB) node.NDDB = NDDB;
if ('undefined' !== typeof store) node.store = store;
node.support = JSUS.compatibility();
}
})('object' === typeof module ? module.exports : (window.node = {}));
|